updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / svl / additions.patch
blob95fede7e6597b65a60571d684c0da5960bcd992c
1 --- svl-1.5/makefiles/config-linux_RH.mf 2002-11-04 23:36:12.000000000 -0500
2 +++ svl-1.5.mine/makefiles/config-linux_RH.mf 2007-04-20 01:39:43.000000000 -0400
3 @@ -13,7 +13,6 @@ CPP = gcc -x c -E
4 LIBTOOL = libtool
6 LD_FLAGS =
7 -CFLAGS = -O2
8 DBG_CFLAGS = -g
10 DEST = $(REACTOR)
12 --- svl-1.5/src/Mat.cpp 2002-11-03 20:04:00.000000000 -0500
13 +++ svl-1.5.mine/src/Mat.cpp 2007-04-20 00:46:52.982574408 -0400
14 @@ -620,7 +620,7 @@ Mat inv(const Mat &m, Real *determinant,
17 pivot = A.Elt(i, i);
18 - Assert(abs(pivot) > pAssertEps, "(inv) Matrix not invertible");
19 + Assert(::abs(pivot) > pAssertEps, "(inv) Matrix not invertible");
20 det *= pivot;
22 for (k = i + 1; k < n; k++) // Only do elements to the right of the pivot
24 --- svl-1.5/src/Mat3.cpp 2002-11-03 20:04:00.000000000 -0500
25 +++ svl-1.5.mine/src/Mat3.cpp 2007-04-20 00:07:11.078852900 -0400
26 @@ -177,6 +177,24 @@ Mat3 Mat3::operator / (Real s) const
27 return(result);
30 +Mat3& Mat3::elem_prod(const Mat3 &m)
32 + row[0].elem_prod( m.row[0] );
33 + row[1].elem_prod( m.row[1] );
34 + row[2].elem_prod( m.row[2] );
36 + return(SELF);
39 +Mat3& Mat3::elem_quot(const Mat3 &m)
41 + row[0].elem_quot( m.row[0] );
42 + row[1].elem_quot( m.row[1] );
43 + row[2].elem_quot( m.row[2] );
45 + return(SELF);
48 Mat3 trans(const Mat3 &m)
50 #define M(x,y) m[x][y]
52 --- svl-1.5/src/Vec3.cpp 2002-11-03 20:04:00.000000000 -0500
53 +++ svl-1.5.mine/src/Vec3.cpp 2007-04-20 00:07:11.059854901 -0400
54 @@ -11,6 +11,7 @@
57 #include "svl/Vec3.h"
58 +#include "svl/Mat3.h"
59 #include <cctype>
60 #include <iomanip>
62 @@ -63,3 +64,17 @@ istream &operator >> (istream &s, Vec3 &
63 return(s);
66 +Mat3 Vec3::trans_prod(const Vec3 &a) const
68 +#define R(x,y) result[x][y]
70 + Mat3 result;
72 + R(0,0) = elt[0]*a[0]; R(0,1) = elt[0]*a[1]; R(0,2) = elt[0]*a[2];
73 + R(1,0) = elt[1]*a[0]; R(1,1) = elt[1]*a[1]; R(1,2) = elt[1]*a[2];
74 + R(2,0) = elt[2]*a[0]; R(2,1) = elt[2]*a[1]; R(2,2) = elt[2]*a[2];
76 + return(result);
78 +#undef R
81 --- svl-1.5/include/svl/Mat3.h 2007-04-20 01:07:33.098838970 -0400
82 +++ svl-1.5.mine/include/svl/Mat3.h 2007-04-20 01:10:28.787330059 -0400
83 @@ -68,6 +68,9 @@ public:
84 Mat3 operator * (Real s) const; // M * s
85 Mat3 operator / (Real s) const; // M / s
87 + Mat3& elem_prod(const Mat3 &m); // elementwise product
88 + Mat3& elem_quot(const Mat3 &m); // elementwise quotient
90 // Initialisers
92 Void MakeZero(); // Zero matrix
94 --- svl-1.5/include/svl/Vec3.h 2002-11-03 19:23:00.000000000 -0500
95 +++ svl-1.5.mine/include/svl/Vec3.h 2007-04-20 00:36:36.162533388 -0400
96 @@ -13,6 +13,7 @@
98 #include "svl/Vec2.h"
100 +class Mat3;
102 // --- Vec3 Class -------------------------------------------------------------
104 @@ -66,6 +67,10 @@ public:
105 Vec3 operator / (const Vec3 &a) const; // v / a (vx / ax, ...)
106 Vec3 operator / (Real s) const; // v / s
108 + Vec3& elem_prod(const Vec3 &a); // elementwise product
109 + Vec3& elem_quot(const Vec3 &a); // elementwise quotient
110 + Mat3 trans_prod(const Vec3 &a) const; // row * column vector
112 // Initialisers
114 Vec3 &MakeZero(); // Zero vector
115 @@ -281,6 +286,24 @@ inline Vec3 Vec3::operator / (Real s) co
116 return(result);
119 +inline Vec3& Vec3::elem_prod(const Vec3 &a)
121 + elt[0] *= a[0];
122 + elt[1] *= a[1];
123 + elt[2] *= a[2];
125 + return(SELF);
128 +inline Vec3& Vec3::elem_quot(const Vec3 &a)
130 + elt[0] /= a[0];
131 + elt[1] /= a[1];
132 + elt[2] /= a[2];
134 + return(SELF);
137 inline Vec3 operator * (Real s, const Vec3 &v)
139 return(v * s);