Total members 11621 |It is currently Wed Mar 29, 2017 7:58 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka

All times are UTC [ DST ]



  linear interpolation array c++
Sat Jul 04, 2015 2:13 pm 

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: 34
Have thanks: 1 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : linear interpolation array c++
 AES -S-BOX Linear Algorithm implementation-substitution box     -  
 Variable interpolation     -  
 Nearest neighbor interpolation in C++     -  
 Array difference for associate array     -  
 compare an array with another array?     -  
 Pop the element off the end of array     -  
 PHP Array Functions     -  
 Array shuffle     -  
 Shuffle Array     -  
 Imploding an Array     -  

All times are UTC [ DST ]









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team