Total members 11889 |It is currently Thu Mar 28, 2024 10:39 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





linear interpolation array c++ similar to the linspace function of Matlab.
cpp code
std::vector<double> ClassName::linspace(double a, double b, size_t N) {
double h = (b - a) / static_cast<double>(N-1);
vector<double> xs(N);
vector<double>::iterator x;
double val;
for (x = xs.begin(), val = a; x != xs.end(); ++x, val += h)
*x = val;
return xs;
}




_________________
Sami
PHD student - SAIL - School Of Computing
Queens' University
Canada


Author:
Site Admin
User avatar Posts: 33
Have thanks: 1 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : linear interpolation array c++
 Variable interpolation     -  
 Nearest neighbor interpolation in C++     -  
 AES -S-BOX Linear Algorithm implementation-substitution box     -  
 Build Linear Regression in Python - Supervised Learning     -  
 Array difference for associate array     -  
 compare an array with another array?     -  
 array unshift     -  
 Add elements to the end of an array     -  
 Get array chunk     -  
 XML Document into an Array in php     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com