Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Geometry::MatrixVectorPairBuilder Class Reference

#include <MatrixVectorPairParser.h>

Public Member Functions

void addCurrentStateToResult ()
 Adds currently stored state to the parse result. More...
 
void advanceRow ()
 Advance to the next row of the matrix/vector pair. More...
 
template<typename T >
MatrixVectorPair< T, V3RgetMatrixVectorPair () const
 Construct and return the actual matrix/vector pair, the rational matrix components are castd to T. More...
 
 MatrixVectorPairBuilder ()
 
void reset ()
 Completely reset the builder, including stored preliminary results. More...
 
void resetAccumulatedResults ()
 Reset all accumulated results. More...
 
void resetState ()
 Reset the current state, i.e. the state representing the current row. More...
 
void setCurrentDirection (const std::string &vector)
 Set the direction vector to one of the stored values that correspond to x, y or z. More...
 
void setCurrentFactor (const ParsedRationalNumber &rationalNumberComponents)
 Set the current factor, which is a rational number. More...
 
void setCurrentSignNegative ()
 Make the current sign negative. More...
 
void setCurrentSignPositive ()
 Make the current sign positive. More...
 

Private Attributes

V3R m_currentDirection
 
RationalNumber m_currentFactor
 
size_t m_currentRow
 
int m_currentSign
 
std::map< std::string, V3Rm_directions
 
std::vector< V3Rm_matrixRows
 
V3R m_vector
 

Detailed Description

Definition at line 23 of file MatrixVectorPairParser.h.

Constructor & Destructor Documentation

◆ MatrixVectorPairBuilder()

Mantid::Geometry::MatrixVectorPairBuilder::MatrixVectorPairBuilder ( )
inline

Definition at line 25 of file MatrixVectorPairParser.h.

References m_directions, and reset().

Member Function Documentation

◆ addCurrentStateToResult()

void Mantid::Geometry::MatrixVectorPairBuilder::addCurrentStateToResult ( )
inline

Adds currently stored state to the parse result.

This function takes the current factor, sign and direction that were assigned using the respective functions and adds to the stored intermediate result.

If the current direction is (0,0,0) then the currently processed component is only a rational number that should go into the vector component of the row that's currently being assembled. Otherwise the direction vector should be multiplied by the rational number and added to the matrix row.

After that, the current state is reset so that the next part of the current component can be processed.

Definition at line 96 of file MatrixVectorPairParser.h.

References m_currentDirection, m_currentFactor, m_currentRow, m_currentSign, m_matrixRows, m_vector, and resetState().

Referenced by Mantid::Geometry::MatrixVectorPairParser< Iterator >::MatrixVectorPairParser().

◆ advanceRow()

void Mantid::Geometry::MatrixVectorPairBuilder::advanceRow ( )
inline

Advance to the next row of the matrix/vector pair.

Definition at line 113 of file MatrixVectorPairParser.h.

References m_currentRow, and resetState().

Referenced by Mantid::Geometry::MatrixVectorPairParser< Iterator >::MatrixVectorPairParser().

◆ getMatrixVectorPair()

template<typename T >
MatrixVectorPair< T, V3R > Mantid::Geometry::MatrixVectorPairBuilder::getMatrixVectorPair ( ) const
inline

Construct and return the actual matrix/vector pair, the rational matrix components are castd to T.

Definition at line 37 of file MatrixVectorPairParser.h.

References m_currentRow, m_matrixRows, m_vector, Mantid::Geometry::x, Mantid::Geometry::y, and Mantid::Geometry::z.

Referenced by Mantid::Geometry::parseMatrixVectorPair().

◆ reset()

void Mantid::Geometry::MatrixVectorPairBuilder::reset ( )
inline

Completely reset the builder, including stored preliminary results.

Definition at line 119 of file MatrixVectorPairParser.h.

References resetAccumulatedResults(), and resetState().

Referenced by MatrixVectorPairBuilder().

◆ resetAccumulatedResults()

void Mantid::Geometry::MatrixVectorPairBuilder::resetAccumulatedResults ( )
inline

Reset all accumulated results.

Definition at line 132 of file MatrixVectorPairParser.h.

References m_currentRow, m_matrixRows, and m_vector.

Referenced by reset().

◆ resetState()

void Mantid::Geometry::MatrixVectorPairBuilder::resetState ( )
inline

Reset the current state, i.e. the state representing the current row.

Definition at line 125 of file MatrixVectorPairParser.h.

References m_currentDirection, m_currentFactor, and m_currentSign.

Referenced by addCurrentStateToResult(), advanceRow(), and reset().

◆ setCurrentDirection()

void Mantid::Geometry::MatrixVectorPairBuilder::setCurrentDirection ( const std::string &  vector)
inline

Set the direction vector to one of the stored values that correspond to x, y or z.

Definition at line 72 of file MatrixVectorPairParser.h.

References m_currentDirection, and m_directions.

Referenced by Mantid::Geometry::MatrixVectorPairParser< Iterator >::MatrixVectorPairParser().

◆ setCurrentFactor()

void Mantid::Geometry::MatrixVectorPairBuilder::setCurrentFactor ( const ParsedRationalNumber rationalNumberComponents)
inline

Set the current factor, which is a rational number.

Depending on whether a direction definition follows, it's processed differently later on.

Definition at line 55 of file MatrixVectorPairParser.h.

References m_currentFactor.

Referenced by Mantid::Geometry::MatrixVectorPairParser< Iterator >::MatrixVectorPairParser().

◆ setCurrentSignNegative()

void Mantid::Geometry::MatrixVectorPairBuilder::setCurrentSignNegative ( )
inline

Make the current sign negative.

Definition at line 75 of file MatrixVectorPairParser.h.

References m_currentSign.

Referenced by Mantid::Geometry::MatrixVectorPairParser< Iterator >::MatrixVectorPairParser().

◆ setCurrentSignPositive()

void Mantid::Geometry::MatrixVectorPairBuilder::setCurrentSignPositive ( )
inline

Make the current sign positive.

Definition at line 78 of file MatrixVectorPairParser.h.

References m_currentSign.

Referenced by Mantid::Geometry::MatrixVectorPairParser< Iterator >::MatrixVectorPairParser().

Member Data Documentation

◆ m_currentDirection

V3R Mantid::Geometry::MatrixVectorPairBuilder::m_currentDirection
private

◆ m_currentFactor

RationalNumber Mantid::Geometry::MatrixVectorPairBuilder::m_currentFactor
private

Definition at line 144 of file MatrixVectorPairParser.h.

Referenced by addCurrentStateToResult(), resetState(), and setCurrentFactor().

◆ m_currentRow

size_t Mantid::Geometry::MatrixVectorPairBuilder::m_currentRow
private

◆ m_currentSign

int Mantid::Geometry::MatrixVectorPairBuilder::m_currentSign
private

◆ m_directions

std::map<std::string, V3R> Mantid::Geometry::MatrixVectorPairBuilder::m_directions
private

Definition at line 139 of file MatrixVectorPairParser.h.

Referenced by MatrixVectorPairBuilder(), and setCurrentDirection().

◆ m_matrixRows

std::vector<V3R> Mantid::Geometry::MatrixVectorPairBuilder::m_matrixRows
private

◆ m_vector

V3R Mantid::Geometry::MatrixVectorPairBuilder::m_vector
private

The documentation for this class was generated from the following file: