A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
arraycreator.h File Reference

Functions for creating arrays with similar syntax to MATLAB. More...

Go to the source code of this file.

Functions

template<typename T , typename U >
U * linspace (T start, T end, int num_values)
 Creates an array of equally spaced values. More...
 
template<typename T , typename U >
U * logspace (T start, T end, int num_values)
 Creates an array of equal logarithmically spaced values. More...
 

Detailed Description

Functions for creating arrays with similar syntax to MATLAB.

Author
William Boyd (wboyd.nosp@m.@mit.nosp@m..edu)
Date
March 28, 2012

Function Documentation

template<typename T , typename U >
U* linspace ( start,
end,
int  num_values 
)

Creates an array of equally spaced values.

Helper function to generate an array of equally spaced values between a specified start and end point. Modeled after MATLAB's linspace function.

Parameters
startthe starting point
endthe ending point
num_valuesthe number of values to create
Returns
a pointer to the array of points
template<typename T , typename U >
U* logspace ( start,
end,
int  num_values 
)

Creates an array of equal logarithmically spaced values.

Helper function to generate an array of equal logarithmically spaced values between a specified start and end point. Modeled after MATLAB's logspace function.

Parameters
startthe starting point
endthe ending point
num_valuesthe number of values to create
Returns
a pointer to the array of points