mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 14:22:54 -06:00
.examples improved Android builder example
git-svn-id: svn://ultimatepp.org/upp/trunk@8659 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a33bb135de
commit
4387f25403
7 changed files with 150 additions and 80 deletions
|
|
@ -26,7 +26,6 @@ Vector::Vector(const Vector& vec)
|
|||
for(int i = 0; i < size; i++) {
|
||||
data[i] = vec.data[i];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,6 +34,28 @@ Vector::~Vector()
|
|||
delete[] data;
|
||||
}
|
||||
|
||||
float Vector::Get(int id) const
|
||||
{
|
||||
return this->data[id];
|
||||
}
|
||||
|
||||
int Vector::GetSize() const
|
||||
{
|
||||
return this->size;
|
||||
}
|
||||
|
||||
void Vector::Set(int id, float value)
|
||||
{
|
||||
this->data[id] = value;
|
||||
}
|
||||
|
||||
void Vector::MultipleByScalar(float scalar)
|
||||
{
|
||||
for(int i = 0; i < size; i++) {
|
||||
this->data[i] *= scalar;
|
||||
}
|
||||
}
|
||||
|
||||
std::string Vector::ToString() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,12 @@ public:
|
|||
Vector(const Vector& vec);
|
||||
virtual ~Vector();
|
||||
|
||||
int GetSize() const { return this->size; }
|
||||
float Get(int id) const;
|
||||
int GetSize() const;
|
||||
|
||||
void Set(int id, float value);
|
||||
|
||||
void MultipleByScalar(float scalar);
|
||||
|
||||
std::string ToString() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue