Class: Ropt::VectorMatrixMath::OperationVectors
- Inherits:
-
Object
- Object
- Ropt::VectorMatrixMath::OperationVectors
- Defined in:
- lib/ropt/vector_matrix_math/operation_vectors.rb
Overview
class-wrapper for converting arrays to objects of vectors with option of inner product
Instance Attribute Summary collapse
-
#vector1 ⇒ Object
Returns the value of attribute vector1.
-
#vector2 ⇒ Object
Returns the value of attribute vector2.
Instance Method Summary collapse
-
#initialize(vector1, vector2) ⇒ OperationVectors
constructor
A new instance of OperationVectors.
- #inner_product ⇒ Object
Constructor Details
#initialize(vector1, vector2) ⇒ OperationVectors
Returns a new instance of OperationVectors.
12 13 14 15 |
# File 'lib/ropt/vector_matrix_math/operation_vectors.rb', line 12 def initialize(vector1, vector2) @vector1 = ShellVector.create(vector1) @vector2 = ShellVector.create(vector2) end |
Instance Attribute Details
#vector1 ⇒ Object
Returns the value of attribute vector1.
10 11 12 |
# File 'lib/ropt/vector_matrix_math/operation_vectors.rb', line 10 def vector1 @vector1 end |
#vector2 ⇒ Object
Returns the value of attribute vector2.
10 11 12 |
# File 'lib/ropt/vector_matrix_math/operation_vectors.rb', line 10 def vector2 @vector2 end |
Instance Method Details
#inner_product ⇒ Object
17 18 19 |
# File 'lib/ropt/vector_matrix_math/operation_vectors.rb', line 17 def inner_product vector1.inner_product(vector2) end |