|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
#include <GIDI_data.hpp>
Public Member Functions | |
| Vector (std::size_t a_number=0) | |
| Vector (std::vector< double > const &a_values) | |
| Vector (std::size_t a_number, double const *a_values) | |
| Vector (Vector const &a_vector) | |
| ~Vector () | |
| Vector & | operator= (Vector const &a_rhs) |
| std::size_t | size () const |
| void | resize (std::size_t a_number, double a_value=0.0) |
| std::vector< double > & | data () |
| double & | operator[] (std::size_t a_index) |
| double | operator[] (std::size_t a_index) const |
| Vector | operator+ (double a_value) const |
| Vector & | operator+= (double a_value) |
| Vector | operator+ (Vector const &a_rhs) const |
| Vector & | operator+= (Vector const &a_rhs) |
| Vector | operator- (double a_value) const |
| Vector & | operator-= (double a_value) |
| Vector | operator- (Vector const &a_rhs) const |
| Vector & | operator-= (Vector const &a_rhs) |
| Vector | operator* (double a_value) const |
| Vector & | operator*= (double a_value) |
| Vector | operator/ (double a_value) const |
| Vector & | operator/= (double a_value) |
| void | reverse () |
| void | setToValueInFlatRange (std::size_t a_start, std::size_t a_end, double a_value) |
| double | sum () |
| void | print (std::string const &a_prefix) const |
| void | write (FILE *a_file, std::string const &a_prefix) const |
| void | writeWithBoundaries (FILE *a_file, char const *a_format, std::vector< double > const &a_boundaries, double a_epsilon) const |
This class stores a mathematical vector and has methods that perform several vector operations (e.g., addition, subtraction).
Definition at line 63 of file GIDI_data.hpp.
| GIDI::Vector::Vector | ( | std::size_t | a_size = 0 | ) |
| a_size | [in] Number of initial elements of the matrix. All elements are initialized to 0. |
Definition at line 25 of file GIDI_vector.cc.
Referenced by operator*(), operator*=(), operator+(), operator+(), operator+=(), operator+=(), operator-(), operator-(), operator-=(), operator-=(), operator/(), operator/=(), operator=(), Vector(), and writeWithBoundaries().
| GIDI::Vector::Vector | ( | std::vector< double > const & | a_values | ) |
| a_values | [in] A list of doubles to initialize this with. |
Definition at line 35 of file GIDI_vector.cc.
| GIDI::Vector::Vector | ( | std::size_t | a_number, |
| double const * | a_values ) |
| a_number | [in] This number of element pointed to by a_values. |
| a_values | [in] A list of doubles to initialize this with. |
Definition at line 46 of file GIDI_vector.cc.
| GIDI::Vector::Vector | ( | Vector const & | a_vector | ) |
| a_vector | [in] Vector to copy. |
Definition at line 57 of file GIDI_vector.cc.
| GIDI::Vector::~Vector | ( | ) |
Definition at line 80 of file GIDI_vector.cc.
|
inline |
Definition at line 81 of file GIDI_data.hpp.
Referenced by GIDI::gridded1d2GIDI_Ys1d(), and GIDI::Functions::FissionEnergyRelease::multiGroupQ().
| Vector GIDI::Vector::operator* | ( | double | a_value | ) | const |
Returns a new Vector whose elements are this multiplied by a_value.
| a_value | [in] The value to multiply each element by. |
Definition at line 219 of file GIDI_vector.cc.
| Vector & GIDI::Vector::operator*= | ( | double | a_value | ) |
Multiplies each element of this by a_value.
| a_value | [in] The value to multiply each element by. |
Definition at line 234 of file GIDI_vector.cc.
| Vector GIDI::Vector::operator+ | ( | double | a_value | ) | const |
Returns a new Vector whose elements are this plus a_value.
| a_value | [in] The value to add to each element. |
Definition at line 91 of file GIDI_vector.cc.
Adds two Vectors.
| a_rhs | [in] Vector to add to this. |
Definition at line 120 of file GIDI_vector.cc.
| Vector & GIDI::Vector::operator+= | ( | double | a_value | ) |
Adds a_value to each element of this.
| a_value | [in] The value to add to each element. |
Definition at line 106 of file GIDI_vector.cc.
Adds a_rhs to this.
| a_rhs | [in] Vector to add to this. |
Definition at line 135 of file GIDI_vector.cc.
| Vector GIDI::Vector::operator- | ( | double | a_value | ) | const |
Returns a new Vector whose elements are this minus a_value.
| a_value | [in] The value to subtract from each element. |
Definition at line 155 of file GIDI_vector.cc.
Subtracts a_rhs from this.
| a_rhs | [in] Vector to subtract from this. |
Definition at line 184 of file GIDI_vector.cc.
| Vector & GIDI::Vector::operator-= | ( | double | a_value | ) |
Subtracts a_value from each element of this.
| a_value | [in] The value to subtract from each element. |
Definition at line 170 of file GIDI_vector.cc.
Subtracts a_rhs to this.
| a_rhs | [in] Vector to subtract from this. |
Definition at line 199 of file GIDI_vector.cc.
| Vector GIDI::Vector::operator/ | ( | double | a_value | ) | const |
Returns a new Vector whose elements are this divided by a_value.
| a_value | [in] The value to divide each element by. |
Definition at line 248 of file GIDI_vector.cc.
| Vector & GIDI::Vector::operator/= | ( | double | a_value | ) |
Divides each element of this by a_value.
| a_value | [in] The value to divide each element by. |
Definition at line 263 of file GIDI_vector.cc.
Returns a new Vector whose elements are this plus a_rhs.
| a_rhs | [in] The value to add to each element. |
Definition at line 69 of file GIDI_vector.cc.
|
inline |
Returns a reference to the (a_index-1)th element.
Definition at line 83 of file GIDI_data.hpp.
|
inline |
Returns a reference to the (a_index-1)th element.
Definition at line 84 of file GIDI_data.hpp.
| void GIDI::Vector::print | ( | std::string const & | a_prefix | ) | const |
Prints the contents of this to std::cout as one line prefixed with a_prefix.
| a_prefix | [in] Prefix to add to line. |
Definition at line 320 of file GIDI_vector.cc.
|
inline |
Resizes this to a_number elements. For details, see std::vector.resize.
Definition at line 80 of file GIDI_data.hpp.
Referenced by MCGIDI::Functions::Gridded1d::Gridded1d(), operator+=(), operator-=(), and GIDI::parseFlattened1d().
| void GIDI::Vector::reverse | ( | ) |
Reverse the elements of this.
Definition at line 275 of file GIDI_vector.cc.
| void GIDI::Vector::setToValueInFlatRange | ( | std::size_t | a_start, |
| std::size_t | a_end, | ||
| double | a_value ) |
Sets all elements in the range [a_start,a_end) to a_value.
| a_start | [in] The starting flat-cell index of this to fill with a_value. |
| a_end | [in] One after the last flat-cell index of this to fill with a_value. |
| a_value | [in] The value to set each double in the range to. |
Definition at line 296 of file GIDI_vector.cc.
|
inline |
Returns a number of elements of this.
Definition at line 79 of file GIDI_data.hpp.
Referenced by GIDI::ProtareTNSL::combineVectors(), MCGIDI::GIDI_VectorDoublesToMCGIDI_VectorDoubles(), GIDI::gridded1d2GIDI_Ys1d(), GIDI::ProtareSingle::multiGroupDepositionEnergy(), GIDI::Reaction::multiGroupProductMatrix(), operator+=(), operator-=(), GIDI::Matrix::push_back(), reverse(), sum(), GIDI::transportCorrect(), GIDI::vector2GIDI_Ys1d(), and writeWithBoundaries().
| double GIDI::Vector::sum | ( | ) |
Returns the sum over the values of this.
Definition at line 305 of file GIDI_vector.cc.
| void GIDI::Vector::write | ( | FILE * | a_file, |
| std::string const & | a_prefix ) const |
Writes the contents of this to a_file as one line prefixed with a_prefix.
| a_file | [in] A pointer to an opened C FILE instance where the data are to be written. |
| a_prefix | [in] Prefix to add to line. |
Definition at line 334 of file GIDI_vector.cc.
| void GIDI::Vector::writeWithBoundaries | ( | FILE * | a_file, |
| char const * | a_format, | ||
| std::vector< double > const & | a_boundaries, | ||
| double | a_epsilon ) const |
This method writes the contents of this to output a_file with each pair (boundary, value) as one line. Each line is written with the C printf style format as specified via the a_format arguement. If a_epsilon is zero then ( size() + 1 ) lines are printed with the last y-value being the last value in this. If a_epsilon is not zero then ( 2 * size() ) lines are printed with each boundary with index 1 to size() being print at first ( boundary[index] * ( 1 - a_epsilon ) ) and then ( boundary[index] * ( 1 + a_epsilon ) ) as :
boundary[index] * ( 1 - a_epsilon ) ), this[index-1] boundary[index] * ( 1 + a_epsilon ) ), this[index]
| a_file | [in] A pointer to an opened C FILE instance where the data are to be written. |
| a_format | [in] A C printf style format to wrint one line of each (boundary, value) pair. Must include the line feed character. |
| a_boundaries | [in] The list of boundaries. Must contain (size() + 1) values except for the case when size() is 0. |
| a_epsilon | [in] Prefix to add to line. |
Definition at line 357 of file GIDI_vector.cc.