Total members 11678 |It is currently Sat Nov 25, 2017 5:04 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++
 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?     -  
 Average of an array. Please help     -  
 C++ array copying     -  
 Pad array to the specified length with a value     -  
 Array C++ Class     -  
 Array size to zero     -  










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