0

Hi there,

I'm trying to develop some old code (for a class to model affine transformations) which was working thanks to a Daniweb member. The old code is

```
void IFS::eval(float x, float y, float& a, float&b)
{
a = (matrix[0]*x + matrix[1]*y + matrix[2]);
b = (matrix[3]*x + matrix[4]*y + matrix[5]);
}
```

Which evaluates an affine transformation. However, now I would like this code to evaluate as many affine transformations as wished. So i took out x,y and replaced with vectors a[j] and b[j]. This is the new code:

```
void IFS::eval(vector <float>& a, vector <float>& b)
{
a[0]=0.0;
b[0]=0.0;
for (int j= 0; j<=50000; j++)
{
a[j] = (matrix[0]*a[j] + matrix[1]*b[j] + matrix[2]);
b[j] = (matrix[3]*a[j] + matrix[4]*b[j] + matrix[5]);
}
}
```

Which now brings about 23 errors. I think possibly it's because I haven't overloaded the << operator to handle the vectors a[j]? Is it possible to overload << for two different inputs? Does anyone know what I am doing wrong?

Thank you very much for any help.

*Edited 5 Years Ago by megaLU*: n/a