Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a VectorFloat to be initialised from a vector<Float> #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions GRT/DataStructures/VectorFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ VectorFloat::VectorFloat(const size_type size, const Float &value){
errorLog.setKey("[ERROR VectorFloat]");
resize(size, value);
}

VectorFloat::VectorFloat(const std::vector<Float>& values){
warningLog.setKey("[WARNING VectorFloat]");
errorLog.setKey("[ERROR VectorFloat]");
*this = Vector<Float>(values);
}


VectorFloat::VectorFloat(const VectorFloat &rhs):Vector(rhs){
warningLog.setKey("[WARNING VectorFloat]");
Expand Down
7 changes: 7 additions & 0 deletions GRT/DataStructures/VectorFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ class VectorFloat : public Vector< Float >{
*/
GRT_API VectorFloat( const std::vector<Float>::size_type size, const Float &value );

/**
Constructor, initializes the VectorFloat from a std::vector<Float>

@param value: the values that will be written to all elements in the vector
*/
GRT_API VectorFloat( const std::vector<Float>& values );

/**
Copy Constructor, copies the values from the rhs VectorFloat to this VectorFloat instance

Expand Down