[nurbs++] * Fix ftbfs
mycae
mycae at fedoraproject.org
Sun Jan 15 23:03:22 UTC 2012
commit e359e948d9b3986d04feefa6d8c395935d358a17
Author: D Haley <nospammycae at yahoo.com>
Date: Sun Dec 18 22:13:11 2011 +0000
* Fix ftbfs
nurbs++-gcc4.4.patch | 59 --
nurbs++-gcc4.patch => nurbs++-gcc4.7.patch | 1278 +++++++++++++++++-----------
nurbs++.spec | 17 +-
3 files changed, 766 insertions(+), 588 deletions(-)
---
diff --git a/nurbs++-gcc4.patch b/nurbs++-gcc4.7.patch
similarity index 79%
rename from nurbs++-gcc4.patch
rename to nurbs++-gcc4.7.patch
index aff3e74..cc53abd 100644
--- a/nurbs++-gcc4.patch
+++ b/nurbs++-gcc4.7.patch
@@ -1,45 +1,42 @@
-diff -ruh ./image/color.cpp ./image/color.cpp
---- ./image/color.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./image/color.cpp 2009-01-24 18:36:20.000000000 +1100
-@@ -50,7 +50,7 @@
+diff -r 8917adf507c7 image/color.cpp
+--- image/color.cpp Sun Jan 15 02:36:12 2012 +0000
++++image/color.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -50,6 +50,7 @@
Color blackColor(0,0,0) ;
*/
-- double
-+template<> double
++ template<>
+ double
Matrix<Color>::norm(void) {
#ifdef USE_EXCEPTION
- throw MatrixErr();
-@@ -63,7 +63,7 @@
+@@ -63,6 +64,7 @@
}
#ifndef USING_VCC
-- int Matrix<Color>::read(char* filename,int r, int c) {
-+ template<> int Matrix<Color>::read(char* filename,int r, int c) {
++ template<>
+ int Matrix<Color>::read(char* filename,int r, int c) {
ifstream fin(filename) ;
if(!fin) {
- resize(1,1) ;
-@@ -89,7 +89,7 @@
+@@ -89,6 +91,7 @@
}
#endif
-- int Vector<Color>::minIndex() const {
-+template<> int Vector<Color>::minIndex() const {
++ template<>
+ int Vector<Color>::minIndex() const {
#ifdef USE_EXCEPTION
throw MatrixErr() ;
- #else
-diff -ruh ./image/image.cpp ./image/image.cpp
---- ./image/image.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./image/image.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 image/image.cpp
+--- image/image.cpp Sun Jan 15 02:36:12 2012 +0000
++++image/image.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -55,9 +55,9 @@
void MatrixImage<T>::drawLine(int i1, int j1, int i2, int j2, T color){
int i,j ;
double mx,b ;
- if(i1<0 || j1<0 || i1>rows() || j1>=cols() ){
-+ if(i1<0 || j1<0 || i1>MatrixImage<T>::rows() || j1>=MatrixImage<T>::cols() ){
++ if(i1<0 || j1<0 || i1>this->rows() || j1>=this->cols() ){
#ifdef USE_EXCEPTION
- throw OutOfBound2D(i1,j1,0,rows()-1,0,cols()-1) ;
-+ throw OutOfBound2D(i1,j1,0,MatrixImage<T>::rows()-1,0,MatrixImage<T>::cols()-1) ;
++ throw OutOfBound2D(i1,j1,0,this->rows()-1,0,this->cols()-1) ;
#else
Error error("MatrixImage<T>::drawLine") ;
error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
@@ -48,10 +45,10 @@ diff -ruh ./image/image.cpp ./image/image.cpp
return ;
}
- if(i2 <0 || j2<0 || i2>rows() || j2>=cols() ){
-+ if(i2 <0 || j2<0 || i2>MatrixImage<T>::rows() || j2>=MatrixImage<T>::cols() ){
++ if(i2 <0 || j2<0 || i2>this->rows() || j2>=this->cols() ){
#ifdef USE_EXCEPTION
- throw OutOfBound2D(i2,j2,0,rows()-1,0,cols()-1) ;
-+ throw OutOfBound2D(i2,j2,0,MatrixImage<T>::rows()-1,0,MatrixImage<T>::cols()-1) ;
++ throw OutOfBound2D(i2,j2,0,this->rows()-1,0,this->cols()-1) ;
#else
Error error("MatrixImage<T>::drawLine") ;
error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
@@ -60,7 +57,7 @@ diff -ruh ./image/image.cpp ./image/image.cpp
if(j1==j2){
for(i=minimum(i1,i2);i<=maximum(i1,i2);i++)
- operator()(i,j1) = color ;
-+ MatrixImage<T>:: operator()(i,j1) = color ;
++ this->operator()(i,j1) = color ;
return ;
}
mx = (double)(i1-i2)/(double)(j1-j2) ;
@@ -69,14 +66,14 @@ diff -ruh ./image/image.cpp ./image/image.cpp
for(i=i1;i>=i2;i--){
j = int(((double)i-b)/mx) ;
- operator()(i,j) = color ;
-+ MatrixImage<T>::operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
}
}
else{
for(i=i1;i<=i2;i++){
j = (int)((i-b)/mx) ;
- operator()(i,j) = color ;
-+ MatrixImage<T>::operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
}
}
}
@@ -85,14 +82,14 @@ diff -ruh ./image/image.cpp ./image/image.cpp
for(j=j1;j>=j2;j--){
i = (int)(mx*j+b) ;
- operator()(i,j) = color ;
-+ MatrixImage<T>::operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
}
}
else{
for(j=j1;j<=j2;j++){
i = (int)(mx*j+b) ;
- operator()(i,j) = color ;
-+ MatrixImage<T>::operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
}
}
}
@@ -101,10 +98,10 @@ diff -ruh ./image/image.cpp ./image/image.cpp
for(int y=i-int(ceil(r)) ; y<i+int(ceil(r)) ; y++)
for(int x = j-int(ceil(r)) ; x<j+int(ceil(r)) ; x++){
- if(y>=0 && y<rows() && x>=0 && x<cols()){
-+ if(y>=0 && y<MatrixImage<T>::rows() && x>=0 && x<MatrixImage<T>::cols()){
++ if(y>=0 && y<this->rows() && x>=0 && x<this->cols()){
if( ((y-i)*(y-i)+(x-j)*(x-j))<= r*r)
- operator()(y,x) = color ;
-+ MatrixImage<T>::operator()(y,x) = color ;
++ this->operator()(y,x) = color ;
}
}
}
@@ -114,8 +111,8 @@ diff -ruh ./image/image.cpp ./image/image.cpp
void MatrixImage<T>::store(Matrix<T>& a){
- if(a.rows() != rows() || a.cols() != cols()) {
- a.resize(rows(),cols()) ;
-+ if(a.rows() != MatrixImage<T>::rows() || a.cols() != MatrixImage<T>::cols()) {
-+ a.resize(MatrixImage<T>::rows(),MatrixImage<T>::cols()) ;
++ if(a.rows() != this->rows() || a.cols() != this->cols()) {
++ a.resize(this->rows(),this->cols()) ;
}
T *aptr, *bptr ;
int size,i ;
@@ -123,13 +120,52 @@ diff -ruh ./image/image.cpp ./image/image.cpp
- bptr = m-1 ;
- size = cols()*rows() ;
+ bptr = this->m-1 ;
-+ size = MatrixImage<T>::cols()*MatrixImage<T>::rows() ;
++ size = this->cols()*this->rows() ;
for(i=0;i<size;i++)
*(++aptr) = *(++bptr) ;
}
-diff -ruh ./include/plib_config.h ./include/plib_config.h
---- ./include/plib_config.h 2002-05-25 04:18:37.000000000 +1000
-+++ ./include/plib_config.h 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 include/plib_config.h
+--- include/plib_config.h Sun Jan 15 02:36:12 2012 +0000
++++include/plib_config.h Sun Jan 15 03:56:42 2012 +0000
+@@ -1,4 +1,4 @@
+-/* include/plib_config.h. Generated by configure. */
++/* include/plib_config.h. Generated from plib_config.h.in by configure. */
+ /* include/plib_config.h.in. Generated from configure.in by autoheader. */
+ // define if you want to use exception handling
+ #define USE_EXCEPTION 1
+@@ -18,7 +18,7 @@
+ // define if you can use -frepo
+ /* #undef INCLUDE_TEMPLATE_SOURCE */
+
+-// define if you want Image Magick
++// define if you want Image Magick
+ /* #undef WITH_IMAGE_MAGICK */
+
+ // define if you want to do range validity checking
+@@ -27,19 +27,19 @@
+
+ // Define if you want the matrix to be in column order rather than row order.
+ // Column ordering is used by fortran and OpenGL.
+-#define COLUMN_ORDER 1
++/* #undef COLUMN_ORDER */
+
+ // the name of the package
+-#define PACKAGE "nurbs++"
++#define PACKAGE 1
+
+ // the version of the package
+-#define VERSION "3.0.11"
++#define VERSION 1
+
+ // if the C++ compiler supports namespaces
+ #define HAVE_NAMESPACE 1
+
+ // Specify if OpenGL is present on this system
+-#define WITH_OPENGL 1
++/* #undef WITH_OPENGL */
+
+ // Specify if you are using Solaris with egcs
+ /* #undef USING_GNU_SOLARIS */
@@ -54,7 +54,7 @@
#define USING_LINUX 1
@@ -139,56 +175,66 @@ diff -ruh ./include/plib_config.h ./include/plib_config.h
// Specify if you have abs defined for the Complex type
#define HAS_COMPLEX_ABS 1
-@@ -117,4 +117,4 @@
- #define VERSION "3.0.11"
+@@ -93,7 +93,7 @@
+ #define HAVE_UNISTD_H 1
+
+ /* Name of package */
+-#define PACKAGE "nurbs++"
++#define PACKAGE 1
+
+ /* Define to the address where bug reports for this package should be sent. */
+ #define PACKAGE_BUGREPORT ""
+@@ -114,7 +114,7 @@
+ #define STDC_HEADERS 1
+
+ /* Version number of package */
+-#define VERSION "3.0.11"
++#define VERSION 1
/* Define to 1 if the X Window System is missing or not being used. */
--/* #undef X_DISPLAY_MISSING */
-+#define X_DISPLAY_MISSING 1
-diff -ruh ./matrix/barray2d_uchar.cpp ./matrix/barray2d_uchar.cpp
---- ./matrix/barray2d_uchar.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/barray2d_uchar.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
+ /* #undef X_DISPLAY_MISSING */
+diff -r 8917adf507c7 matrix/barray2d_uchar.cpp
+--- matrix/barray2d_uchar.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/barray2d_uchar.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
namespace PLib {
--ostream&
-+template<> ostream&
++template<>
+ ostream&
Basic2DArray<unsigned char>::print(ostream& os) const
{
- int i, j;
-diff -ruh ./matrix/barray_complex.cpp ./matrix/barray_complex.cpp
---- ./matrix/barray_complex.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/barray_complex.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
+diff -r 8917adf507c7 matrix/barray_complex.cpp
+--- matrix/barray_complex.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/barray_complex.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
namespace PLib {
--ostream&
-+template<> ostream&
++ template<>
+ ostream&
BasicArray<Complex>::print(ostream& os) const{
const int iend = size();
-
-diff -ruh ./matrix/cvector.h ./matrix/cvector.h
---- ./matrix/cvector.h 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/cvector.h 2009-01-24 18:36:21.000000000 +1100
+diff -r 8917adf507c7 matrix/cvector.h
+--- matrix/cvector.h Sun Jan 15 02:36:12 2012 +0000
++++matrix/cvector.h Sun Jan 15 03:56:42 2012 +0000
@@ -54,10 +54,10 @@
CVector(const BasicArray<T>& v) : Vector<T>(v), index(0) {;}
virtual ~CVector() {}
- T& operator[](const int i) { return x[i%sze]; }
- T operator[](const int i) const { return x[i%sze]; }
-+ T& operator[](const int i) { return (this->x)[i%(this->sze)]; }
-+ T operator[](const int i) const { return (this->x)[i%(this->sze)]; }
++ T& operator[](const int i) { return this->x[i%this->sze]; }
++ T operator[](const int i) const { return this->x[i%this->sze]; }
- void put(T v) { x[index] = v ; index = (index+1)%sze; }
-+ void put(T v) { (this->x)[index] = v ; index = (index+1)%(this->sze); }
++ void put(T v) { this->x[index] = v ; this->index = (this->index+1)%this->sze; }
protected:
int index ;
-diff -ruh ./matrix/list.cpp ./matrix/list.cpp
---- ./matrix/list.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/list.cpp 2009-01-24 18:36:24.000000000 +1100
+diff -r 8917adf507c7 matrix/list.cpp
+--- matrix/list.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/list.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -26,35 +26,36 @@
#ifdef NO_IMPLICIT_TEMPLATES
@@ -207,7 +253,7 @@ diff -ruh ./matrix/list.cpp ./matrix/list.cpp
-template class BasicNode<PLib::Point2Dd> ;
-template class BasicNode<PLib::HPoint2Dd> ;
-template class BasicNode<PLib::Coordinate> ;
--
+
-template class BasicList<float> ;
-template class BasicList<double> ;
-template class BasicList<int> ;
@@ -222,7 +268,6 @@ diff -ruh ./matrix/list.cpp ./matrix/list.cpp
-template class BasicList<PLib::Point2Dd> ;
-template class BasicList<PLib::HPoint2Dd> ;
-template class BasicList<PLib::Coordinate> ;
-+
+template class PLib::BasicNode<float> ;
+template class PLib::BasicNode<double> ;
+template class PLib::BasicNode<int> ;
@@ -255,9 +300,9 @@ diff -ruh ./matrix/list.cpp ./matrix/list.cpp
#endif
-diff -ruh ./matrix/list.h ./matrix/list.h
---- ./matrix/list.h 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/list.h 2009-01-24 18:36:21.000000000 +1100
+diff -r 8917adf507c7 matrix/list.h
+--- matrix/list.h Sun Jan 15 02:36:12 2012 +0000
++++matrix/list.h Sun Jan 15 03:56:42 2012 +0000
@@ -28,6 +28,7 @@
#include "specialType.h"
@@ -273,72 +318,21 @@ diff -ruh ./matrix/list.h ./matrix/list.h
-
+}
#endif
-diff -ruh ./matrix/matrix_char.cpp ./matrix/matrix_char.cpp
---- ./matrix/matrix_char.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_char.cpp 2009-01-24 18:36:24.000000000 +1100
-@@ -27,7 +27,7 @@
-
- namespace PLib {
-
-- Matrix<char>&
-+template<> Matrix<char>&
- Matrix<char>::operator*=(double a)
- {
- char *p1 ;
-@@ -40,7 +40,7 @@
- return *this ;
- }
-
-- Matrix<char>&
-+template<> Matrix<char>&
- Matrix<char>::operator+=(double a)
- {
- char *p1 ;
-@@ -51,7 +51,7 @@
- return *this ;
- }
-
-- Matrix<char>&
-+ template<> Matrix<char>&
- Matrix<char>::operator-=(double a)
- {
- char *p1 ;
-@@ -62,7 +62,7 @@
- return *this ;
- }
-
-- Matrix<char>&
-+ template<> Matrix<char>&
- Matrix<char>::operator/=(double a)
- {
- char *p1 ;
-diff -ruh ./matrix/matrix_complex.cpp ./matrix/matrix_complex.cpp
---- ./matrix/matrix_complex.cpp 2002-05-25 03:25:49.000000000 +1000
-+++ ./matrix/matrix_complex.cpp 2009-01-24 18:36:24.000000000 +1100
-@@ -27,7 +27,7 @@
-
- namespace PLib {
-
-- double Matrix<Complex>::norm(void){
-+ template<> double Matrix<Complex>::norm(void){
- int i,j ;
- double sumR, sumI, maxsum;
- int init=0 ;
-diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
---- ./matrix/matrix.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix.cpp 2009-01-24 18:36:21.000000000 +1100
+diff -r 8917adf507c7 matrix/matrix.cpp
+--- matrix/matrix.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -54,19 +54,19 @@
if ( this == &a )
return *this;
- if ( a.rows() != rows() || a.cols() != cols() ){
- resize(a.rows(),a.cols()) ;
-+ if ( a.rows() !=Matrix<T>::rows() || a.cols() !=Matrix<T>::cols() ){
++ if ( a.rows() != this->rows() || a.cols() != this->cols() ){
+ this->resize(a.rows(),a.cols()) ;
}
- int sze = rows()*cols() ;
-+ int sze =(Matrix<T>::rows())*(Matrix<T>::cols()) ;
++ int sze = this->rows()*this->cols() ;
T *ptr, *aptr ;
- ptr = m-1 ;
+ ptr = this->m-1 ;
@@ -357,11 +351,11 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
int rwz,coz,i,j;
- if ( rows() % a.rows() != 0 || cols() % a.cols() != 0 || rows() < a.rows() || cols() < a.cols() )
-+ if (Matrix<T>::rows() % a.rows() != 0 ||Matrix<T>::cols() % a.cols() != 0 ||Matrix<T>::rows() < a.rows() ||Matrix<T>::cols() < a.cols() )
++ if ( this->rows() % a.rows() != 0 || this->cols() % a.cols() != 0 || this->rows() < a.rows() || this->cols() < a.cols() )
{
#ifdef USE_EXCEPTION
- throw WrongSize2D(rows(),cols(),a.rows(),a.cols()) ;
-+ throw WrongSize2D(Matrix<T>::rows(),Matrix<T>::cols(),a.rows(),a.cols()) ;
++ throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols()) ;
#else
Error error("Matrix<T>::submatrix");
error << "Matrix and submatrix incommensurate" ;
@@ -370,31 +364,24 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
}
- if ( sr >= rows()/a.rows() || sr < 0 || sc >= cols()/a.cols() || sc < 0 )
-+ if ( sr >=Matrix<T>::rows()/a.rows() || sr < 0 || sc >=Matrix<T>::cols()/a.cols() || sc < 0 )
++ if ( sr >= this->rows()/a.rows() || sr < 0 || sc >= this->cols()/a.cols() || sc < 0 )
{
#ifdef USE_EXCEPTION
- throw OutOfBound2D(sr,sc,0,rows()/a.rows()-1,0,cols()/a.cols()-1) ;
-+ throw OutOfBound2D(sr,sc,0,Matrix<T>::rows()/a.rows()-1,0,Matrix<T>::cols()/a.cols()-1) ;
++ throw OutOfBound2D(sr,sc,0,this->rows()/a.rows()-1,0,this->cols()/a.cols()-1) ;
#else
Error error("Matrix<T>::submatrix");
- error << "Submatrix location out of bounds.\nrowblock " << sr << ", " << rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
-+ error << "Submatrix location out of bounds.\nrowblock " << sr << ", " <<Matrix<T>::rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
++ error << "Submatrix location out of bounds.\nrowblock " << sr << ", " << this->rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
error.fatal() ;
#endif
}
-@@ -127,13 +127,13 @@
- #ifdef COLUMN_ORDER
- for ( i = a.rows()-1; i >= 0; --i )
- for(j=a.cols()-1;j>=0;--j)
-- elem(i+rwz,j+coz) = a(i,j) ;
-+ this->elem(i+rwz,j+coz) = a(i,j) ;
- #else
- T *ptr, *aptr ;
+@@ -133,7 +133,7 @@
aptr = a.m - 1;
for ( i = a.rows()-1; i >= 0; --i )
{
- ptr = &m[(i+rwz)*cols()+coz]-1 ;
-+ ptr = &(this->m)[(i+rwz)*Matrix<T>::cols()+coz]-1 ;
++ ptr = &this->m[(i+rwz)*this->cols()+coz]-1 ;
for ( j = a.cols(); j > 0; --j)
*(++ptr) = *(++aptr) ;
}
@@ -403,22 +390,16 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
int i, j;
- if ( (rw + a.rows()) > rows() || ( cl + a.cols()) > cols()) {
-+ if ( (rw + a.rows()) >Matrix<T>::rows() || ( cl + a.cols()) >Matrix<T>::cols()) {
++ if ( (rw + a.rows()) > this->rows() || ( cl + a.cols()) > this->cols()) {
#ifdef USE_EXCEPTION
throw MatrixErr();
#else
-@@ -172,12 +172,12 @@
- #ifdef COLUMN_ORDER
- for(i=0;i<a.rows();++i)
- for(j=0;j<a.cols();++j)
-- elem(i+rw,j+cl) = a(i,j) ;
-+ this->elem(i+rw,j+cl) = a(i,j) ;
- #else
+@@ -177,7 +177,7 @@
T *pptr,*aptr ;
aptr = a.m-1 ;
for ( i = 0; i<a.rows(); ++i) {
- pptr = &m[(i+rw)*cols()+cl]-1 ;
-+ pptr = &(this->m)[(i+rw)*Matrix<T>::cols()+cl]-1 ;
++ pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
for ( j = 0; j < a.cols(); ++j)
*(++pptr) = *(++aptr);
}
@@ -436,22 +417,16 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
{
Matrix<T> getmat(nr,nc) ;
- if ( (rw+nr) > rows() || (cl+nc) > cols()) {
-+ if ( (rw+nr) >Matrix<T>::rows() || (cl+nc) >Matrix<T>::cols()) {
++ if ( (rw+nr) > this->rows() || (cl+nc) > this->cols()) {
#ifdef USE_EXCEPTION
throw MatrixErr();
#else
-@@ -223,12 +223,12 @@
- #ifdef COLUMN_ORDER
- for(i=0;i<nr;++i)
- for(j=0;j<nc;++j)
-- getmat(i,j) = elem(i+rw,j+cl) ;
-+ getmat(i,j) = this->elem(i+rw,j+cl) ;
- #else
+@@ -228,7 +228,7 @@
T *pptr,*aptr ;
aptr = getmat.m-1;
for (i = 0; i < nr; ++i) {
- pptr = &m[(i+rw)*cols()+cl]-1 ;
-+ pptr = &(this->m)[(i+rw)*Matrix<T>::cols()+cl]-1 ;
++ pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
for ( j = 0; j < nc; ++j)
*(++aptr) = *(++pptr) ;
}
@@ -463,10 +438,10 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
+ pptr = this->m-1 ;
maxsum = 0 ; // Silence the warning message
- for(i=0;i<rows();++i){
-+ for(i=0;i<Matrix<T>::rows();++i){
++ for(i=0;i<this->rows();++i){
sum = 0 ;
- for ( j = 0; j < cols(); ++j)
-+ for ( j = 0; j <Matrix<T>::cols(); ++j)
++ for ( j = 0; j < this->cols(); ++j)
sum += *(++pptr) ;
if(init)
maxsum = (maxsum>sum) ? maxsum : sum;
@@ -477,9 +452,9 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- iend = rows();
- if ( iend > cols() )
- iend = cols();
-+ iend =Matrix<T>::rows();
-+ if ( iend >Matrix<T>::cols() )
-+ iend =Matrix<T>::cols();
++ iend = this->rows();
++ if ( iend > this->cols() )
++ iend = this->cols();
for (i = iend-1; i >=0; --i)
- elem(i,i) = a;
@@ -493,8 +468,8 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
int i, iend;
- Vector<T> vec(minimum(rows(),cols())) ;
- iend = minimum(rows(),cols());
-+ Vector<T> vec(minimum(Matrix<T>::rows(),Matrix<T>::cols())) ;
-+ iend = minimum(Matrix<T>::rows(),Matrix<T>::cols());
++ Vector<T> vec(minimum(this->rows(),this->cols())) ;
++ iend = minimum(this->rows(),this->cols());
for (i = iend-1; i >=0; --i)
- vec[i] = elem(i,i);
+ vec[i] = this->elem(i,i);
@@ -508,7 +483,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- p1 = m-1 ;
- const int size = rows()*cols() ;
+ p1 = this->m-1 ;
-+ const int size =Matrix<T>::rows()*Matrix<T>::cols() ;
++ const int size = this->rows()*this->cols() ;
for(int i=size; i>0; --i)
*(++p1) += a ;
return *this ;
@@ -519,7 +494,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- p1 = m-1 ;
- const int size = rows()*cols() ;
+ p1 = this->m-1 ;
-+ const int size =Matrix<T>::rows()*Matrix<T>::cols() ;
++ const int size = this->rows()*this->cols() ;
for(int i=size; i>0; --i)
*(++p1) -= a ;
return *this ;
@@ -530,7 +505,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- p1 = m-1 ;
- const int size = rows()*cols() ;
+ p1 = this->m-1 ;
-+ const int size =Matrix<T>::rows()*Matrix<T>::cols() ;
++ const int size = this->rows()*this->cols() ;
for(int i=size; i>0; --i)
*(++p1) *= a ;
return *this ;
@@ -541,33 +516,23 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- p1 = m-1 ;
- const int size = rows()*cols() ;
+ p1 = this->m-1 ;
-+ const int size =Matrix<T>::rows()*Matrix<T>::cols() ;
++ const int size = this->rows()*this->cols() ;
for(int i=size; i>0; --i)
*(++p1) /= a ;
return *this ;
-@@ -408,16 +408,16 @@
+@@ -408,10 +408,10 @@
template <class T>
Matrix<T>& Matrix<T>::operator+=(const Matrix<T> &a)
{
- if ( a.rows() != rows() || a.cols() != cols() )
-+ if ( a.rows() !=Matrix<T>::rows() || a.cols() !=Matrix<T>::cols() )
++ if ( a.rows() != this->rows() || a.cols() != this->cols() )
{
#ifdef USE_EXCEPTION
- throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
-+ throw WrongSize2D(Matrix<T>::rows(),Matrix<T>::cols(),a.rows(),a.cols());
++ throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
#else
Error error("Matrix<T>::operator+=") ;
-- if ( rows() != a.rows() )
-- error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
-- if ( cols() != a.cols())
-- error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
-+ if (Matrix<T>::rows() != a.rows() )
-+ error << "Matrices are of diferent size, a.rows() = " <<Matrix<T>::rows() << " and b.rows() = " << a.rows() << endl ;
-+ if (Matrix<T>::cols() != a.cols())
-+ error << "Matrices are of diferent size, a.cols() = " <<Matrix<T>::cols() << " and b.cols() = " << a.cols() << endl ;
- error.fatal() ;
- #endif
- }
+ if ( rows() != a.rows() )
@@ -425,8 +425,8 @@
int i, sze ;
T *aptr,*sptr ;
@@ -575,33 +540,23 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- sptr = m - 1 ;
- sze = rows()*cols() ;
+ sptr = this->m - 1 ;
-+ sze =Matrix<T>::rows()*Matrix<T>::cols() ;
++ sze = this->rows()*this->cols() ;
for (i = sze; i > 0; --i){
*(++sptr) += *(++aptr) ;
}
-@@ -468,16 +468,16 @@
+@@ -468,10 +468,10 @@
template <class T>
Matrix<T>& Matrix<T>::operator-=(const Matrix<T> &a)
{
- if ( a.rows() != rows() || a.cols() != cols() )
-+ if ( a.rows() !=Matrix<T>::rows() || a.cols() !=Matrix<T>::cols() )
++ if ( a.rows() != this->rows() || a.cols() != this->cols() )
{
#ifdef USE_EXCEPTION
- throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
-+ throw WrongSize2D(Matrix<T>::rows(),Matrix<T>::cols(),a.rows(),a.cols());
++ throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
#else
Error error("Matrix<T>::operator-=") ;
-- if ( rows() != a.rows() )
-- error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
-- if ( cols() != a.cols())
-- error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
-+ if (Matrix<T>::rows() != a.rows() )
-+ error << "Matrices are of diferent size, a.rows() = " <<Matrix<T>::rows() << " and b.rows() = " << a.rows() << endl ;
-+ if (Matrix<T>::cols() != a.cols())
-+ error << "Matrices are of diferent size, a.cols() = " <<Matrix<T>::cols() << " and b.cols() = " << a.cols() << endl ;
- error.fatal() ;
- #endif
- }
+ if ( rows() != a.rows() )
@@ -485,8 +485,8 @@
int i, size;
T *aptr,*sptr ;
@@ -609,7 +564,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- sptr = m - 1 ;
- size = rows()*cols() ;
+ sptr = this->m - 1 ;
-+ size =Matrix<T>::rows()*Matrix<T>::cols() ;
++ size = this->rows()*this->cols() ;
for (i = size; i > 0; --i){
*(++sptr) -= *(++aptr) ;
}
@@ -618,13 +573,13 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
T Matrix<T>::trace() const
{
- int size = rows();
-+ int size =Matrix<T>::rows();
++ int size = this->rows();
T sum = (T)0;
- if ( size > cols() )
- size = cols();
-+ if ( size >Matrix<T>::cols() )
-+ size =Matrix<T>::cols();
++ if ( size > this->cols() )
++ size = this->cols();
for (int d = 0; d < size; ++d)
- sum += elem(d,d) ;
@@ -637,7 +592,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
Matrix<T> Matrix<T>::herm() const
{
- int i, j, r = cols(), c = rows();
-+ int i, j, r =Matrix<T>::cols(), c =Matrix<T>::rows();
++ int i, j, r = this->cols(), c = this->rows();
Matrix<T> adj(r,c);
for (i = 0; i < r; ++i)
@@ -654,12 +609,12 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- Matrix<T> f(rows(),cols()) ;
- for(int i=rows()-1;i>=0;--i)
- for(int j=cols()-1;j>=0;--j)
-+ Matrix<T> f(Matrix<T>::rows(),Matrix<T>::cols()) ;
-+ for(int i=Matrix<T>::rows()-1;i>=0;--i)
-+ for(int j=Matrix<T>::cols()-1;j>=0;--j)
++ Matrix<T> f(this->rows(),this->cols()) ;
++ for(int i=this->rows()-1;i>=0;--i)
++ for(int j=this->cols()-1;j>=0;--j)
{
- f(i,j) = elem(i,cols()-j-1);
-+ f(i,j) = this->elem(i,Matrix<T>::cols()-j-1);
++ f(i,j) = this->elem(i,this->cols()-j-1);
}
return f;
}
@@ -669,8 +624,8 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
int i, j;
- const int& r = cols();
- const int& c = rows();
-+ const int& r =Matrix<T>::cols();
-+ const int& c =Matrix<T>::rows();
++ const int& r = this->cols();
++ const int& c = this->rows();
Matrix<T> adj(r,c);
for (i = r-1; i >=0; --i)
@@ -705,7 +660,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- resize(r,c) ;
- if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
+ this->resize(r,c) ;
-+ if(!fin.read((char*)(this->m),sizeof(T)*r*c)) return 0 ;
++ if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
delete []type ;
return 1 ;
@@ -729,7 +684,7 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
- resize(r,c) ;
- if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
+ this->resize(r,c) ;
-+ if(!fin.read((char*)(this->m),sizeof(T)*r*c)) return 0 ;
++ if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
return 1 ;
}
@@ -747,12 +702,12 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
return 0 ;
int r,c ;
- r = rows() ; c = cols() ;
-+ r = Matrix<T>::rows() ; c =Matrix<T>::cols() ;
++ r = this->rows() ; c = this->cols() ;
if(!fout.write((char*)&"matrix",sizeof(char)*6)) return 0 ;
if(!fout.write((char*)&r,sizeof(int))) return 0 ;
if(!fout.write((char*)&c,sizeof(int))) return 0 ;
- if(!fout.write((char*)m,sizeof(T)*r*c)) return 0 ;
-+ if(!fout.write((char*)(this->m),sizeof(T)*r*c)) return 0 ;
++ if(!fout.write((char*)this->m,sizeof(T)*r*c)) return 0 ;
return 1;
}
@@ -761,199 +716,259 @@ diff -ruh ./matrix/matrix.cpp ./matrix/matrix.cpp
if(!fout)
return 0 ;
- if(!fout.write((char*)m,sizeof(T)*rows()*cols())) return 0 ;
-+ if(!fout.write((char*)(this->m),sizeof(T)*(Matrix<T>::rows())*(Matrix<T>::cols()))) return 0 ;
++ if(!fout.write((char*)this->m,sizeof(T)*this->rows()*this->cols())) return 0 ;
return 1;
}
-diff -ruh ./matrix/matrix_double.cpp ./matrix/matrix_double.cpp
---- ./matrix/matrix_double.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_double.cpp 2009-01-24 18:36:24.000000000 +1100
-@@ -27,7 +27,7 @@
+diff -r 8917adf507c7 matrix/matrix.h
+--- matrix/matrix.h Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix.h Sun Jan 15 03:56:42 2012 +0000
+@@ -75,7 +75,7 @@
+
+ Matrix<T>& operator=(const Matrix<T>&);
+ T operator=(const T v)
+- { reset((T)0);
++ { this->reset((T)0);
+ diag(v);
+ return v; }
+ void submatrix(int i, int j, Matrix<T>&);
+diff -r 8917adf507c7 matrix/matrix_char.cpp
+--- matrix/matrix_char.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_char.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
namespace PLib {
+
++ template<>
+ Matrix<char>&
+ Matrix<char>::operator*=(double a)
+ {
+@@ -39,7 +40,8 @@
+ }
+ return *this ;
+ }
+-
++
++ template<>
+ Matrix<char>&
+ Matrix<char>::operator+=(double a)
+ {
+@@ -51,6 +53,7 @@
+ return *this ;
+ }
-- void Matrix<double>::qSort(){
-+ template<> void Matrix<double>::qSort(){
++ template<>
+ Matrix<char>&
+ Matrix<char>::operator-=(double a)
+ {
+@@ -62,6 +65,7 @@
+ return *this ;
+ }
+
++ template<>
+ Matrix<char>&
+ Matrix<char>::operator/=(double a)
+ {
+diff -r 8917adf507c7 matrix/matrix_complex.cpp
+--- matrix/matrix_complex.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_complex.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
+
+ namespace PLib {
+
++ template<>
+ double Matrix<Complex>::norm(void){
+ int i,j ;
+ double sumR, sumI, maxsum;
+diff -r 8917adf507c7 matrix/matrix_double.cpp
+--- matrix/matrix_double.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_double.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -26,7 +26,8 @@
+ #include "matrix.cpp"
+
+ namespace PLib {
+-
++
++ template<>
+ void Matrix<double>::qSort(){
qsort((char*)m,rows()*cols(),sizeof(double),compareDouble) ;
}
-
-diff -ruh ./matrix/matrix_float.cpp ./matrix/matrix_float.cpp
---- ./matrix/matrix_float.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_float.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
+diff -r 8917adf507c7 matrix/matrix_float.cpp
+--- matrix/matrix_float.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_float.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -26,7 +26,8 @@
+ #include "matrix.cpp"
namespace PLib {
-
-- void Matrix<float>::qSort(){
-+ template<> void Matrix<float>::qSort(){
+-
++
++ template<>
+ void Matrix<float>::qSort(){
qsort((char*)m,rows()*cols(),sizeof(float),compareFloat) ;
}
-
-diff -ruh ./matrix/matrix_hpoint.cpp ./matrix/matrix_hpoint.cpp
---- ./matrix/matrix_hpoint.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_hpoint.cpp 2009-01-24 18:36:22.000000000 +1100
-@@ -27,7 +27,7 @@
+diff -r 8917adf507c7 matrix/matrix_hpoint.cpp
+--- matrix/matrix_hpoint.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_hpoint.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
namespace PLib {
-- double
-+template<> double
++ template<>
+ double
Matrix<HPoint3Df>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, sumW, maxsum;
-@@ -58,7 +58,7 @@
+@@ -58,6 +59,7 @@
}
-- double
-+ template<> double
++ template<>
+ double
Matrix<HPoint3Dd>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, sumW, maxsum;
-@@ -89,7 +89,7 @@
+@@ -89,6 +91,7 @@
}
-- double
-+ template<> double
++ template<>
+ double
Matrix<HPoint2Df>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, sumW, maxsum;
-@@ -119,7 +119,7 @@
+@@ -119,6 +122,7 @@
return sqrt(maxsum);
}
-- double
-+ template<> double
++ template<>
+ double
Matrix<HPoint2Dd>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, sumW, maxsum;
-diff -ruh ./matrix/matrix_int.cpp ./matrix/matrix_int.cpp
---- ./matrix/matrix_int.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_int.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -29,11 +29,11 @@
+diff -r 8917adf507c7 matrix/matrix_int.cpp
+--- matrix/matrix_int.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_int.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -29,10 +29,12 @@
namespace PLib {
-- void Matrix<int>::qSort(){
-- qsort((char*)m,rows()*cols(),sizeof(int),compareInt) ;
-+template<> void Matrix<int>::qSort(){
-+ qsort((char*)m,Matrix<int>::rows()*Matrix<int>::cols(),sizeof(int),compareInt) ;
++ template<>
+ void Matrix<int>::qSort(){
+ qsort((char*)m,rows()*cols(),sizeof(int),compareInt) ;
}
-- Matrix<int>&
-+template<> Matrix<int>&
++ template<>
+ Matrix<int>&
Matrix<int>::operator*=(double a)
{
- int *p1 ;
-@@ -46,7 +46,7 @@
+@@ -46,6 +48,7 @@
return *this ;
}
-- Matrix<int>&
-+template<> Matrix<int>&
++ template<>
+ Matrix<int>&
Matrix<int>::operator+=(double a)
{
- int *p1 ;
-@@ -57,7 +57,7 @@
+@@ -57,6 +60,7 @@
return *this ;
}
-- Matrix<int>&
-+template<> Matrix<int>&
++ template<>
+ Matrix<int>&
Matrix<int>::operator-=(double a)
{
- int *p1 ;
-@@ -68,7 +68,7 @@
+@@ -68,6 +72,7 @@
return *this ;
}
-- Matrix<int>&
-+template<> Matrix<int>&
++ template<>
+ Matrix<int>&
Matrix<int>::operator/=(double a)
{
- int *p1 ;
-diff -ruh ./matrix/matrix_point.cpp ./matrix/matrix_point.cpp
---- ./matrix/matrix_point.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_point.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
+@@ -95,8 +100,9 @@
+ template Vector<int> operator*(const Matrix<int>&,const Vector<int>&);
+ template int operator==(const Matrix<int>&,const Matrix<int>&);
+ //template int operator!=(const Matrix<int>&,const Matrix<int>&);
+- template Matrix<int> comm(const Matrix<int>&,const Matrix<int>&);
++ template<>
++ Matrix<int> comm(const Matrix<int>&,const Matrix<int>&);
+
+ #endif
++}
+
+-}
+diff -r 8917adf507c7 matrix/matrix_point.cpp
+--- matrix/matrix_point.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_point.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
namespace PLib {
-- double
-+template<> double
++ template<>
+ double
Matrix<Point3Df>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, maxsum;
-@@ -55,7 +55,7 @@
+@@ -55,6 +56,7 @@
return sqrt(maxsum);
}
-- double
-+template<> double
++ template<>
+ double
Matrix<Point3Dd>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, maxsum;
-@@ -83,7 +83,7 @@
+@@ -83,6 +85,7 @@
return sqrt(maxsum);
}
-- double
-+template<> double
++ template<>
+ double
Matrix<Point2Df>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, maxsum;
-@@ -111,7 +111,7 @@
+@@ -111,6 +114,7 @@
return sqrt(maxsum);
}
-- double
-+template<> double
++ template<>
+ double
Matrix<Point2Dd>::norm(void) {
int i,j ;
- double sumX, sumY, sumZ, maxsum;
-diff -ruh ./matrix/matrix_uchar.cpp ./matrix/matrix_uchar.cpp
---- ./matrix/matrix_uchar.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/matrix_uchar.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
+diff -r 8917adf507c7 matrix/matrix_uchar.cpp
+--- matrix/matrix_uchar.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/matrix_uchar.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
namespace PLib {
-- Matrix<unsigned char>&
-+template<> Matrix<unsigned char>&
++ template<>
+ Matrix<unsigned char>&
Matrix<unsigned char>::operator*=(double a)
{
- unsigned char *p1 ;
-@@ -40,7 +40,7 @@
+@@ -40,6 +41,7 @@
return *this ;
}
-- Matrix<unsigned char>&
-+template<> Matrix<unsigned char>&
++ template<>
+ Matrix<unsigned char>&
Matrix<unsigned char>::operator+=(double a)
{
- unsigned char *p1 ;
-@@ -52,7 +52,7 @@
+@@ -51,7 +53,8 @@
+ return *this ;
}
-
-- Matrix<unsigned char>&
-+ template<> Matrix<unsigned char>&
+-
++
++ template<>
+ Matrix<unsigned char>&
Matrix<unsigned char>::operator-=(double a)
{
- unsigned char *p1 ;
-@@ -64,7 +64,7 @@
+@@ -63,7 +66,7 @@
+ return *this ;
}
-
-- Matrix<unsigned char>&
-+ template<> Matrix<unsigned char>&
+-
++ template<>
+ Matrix<unsigned char>&
Matrix<unsigned char>::operator/=(double a)
{
- unsigned char *p1 ;
-diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
---- ./matrix/vector.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/vector.cpp 2009-01-24 18:36:21.000000000 +1100
+diff -r 8917adf507c7 matrix/vector.cpp
+--- matrix/vector.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/vector.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -51,16 +51,16 @@
if(this==&b)
return *this ;
@@ -1018,7 +1033,8 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
+ throw WrongSize(this->size(),a.size()) ;
#else
Error error("Vector<T>::operator+=(Vector<T>&)");
- error << "Vector<T> a += Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
+- error << "Vector<T> a += Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
++ error << "Vector<T> a += Vector<T> b different sizes, a = " << this->size() << ", b = " << a.size() ;
error.fatal() ;
#endif
}
@@ -1060,7 +1076,7 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
T *aptr,*bptr ;
- aptr = &x[i]-1 ;
-+ aptr = &(this->x)[i]-1 ;
++ aptr = &this->x[i]-1 ;
bptr = b.x-1 ;
for ( int j = b.rows(); j > 0; --j)
*(++aptr) = *(++bptr) ;
@@ -1069,7 +1085,7 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
Vector<T> subvec(l) ;
T *aptr, *bptr ;
- aptr = &x[i] - 1 ;
-+ aptr = &(this->x)[i] - 1 ;
++ aptr = &this->x[i] - 1 ;
bptr = subvec.x -1 ;
for ( int j = l; j > 0; --j)
*(++bptr) = *(++aptr) ;
@@ -1101,7 +1117,7 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
while(1){
if(ir-l<M){ // perform an insertion sort when the array is small enough
- v1 = &x[l] ;
-+ v1 = &(this->x)[l] ;
++ v1 = &this->x[l] ;
for(j=l+1;j<=ir;++j){
a = *(++v1) ;
v2 = v1 ;
@@ -1112,13 +1128,13 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
- swap(x[k],x[l+1]) ;
- if(x[l+1] > x[ir]){
- swap(x[l+1],x[ir]) ;
-+ swap((this->x)[k],(this->x)[l+1]) ;
++ swap(this->x[k],this->x[l+1]) ;
+ if(this->x[l+1] > this->x[ir]){
-+ swap((this->x)[l+1],(this->x)[ir]) ;
++ swap(this->x[l+1],this->x[ir]) ;
}
- if(x[l]> x[ir]){
- swap(x[l],x[ir]) ;
-+ if((this->x)[l]> (this->x)[ir]){
++ if(this->x[l]> this->x[ir]){
+ swap(this->x[l],this->x[ir]) ;
}
- if(x[l+1] > x[l]){
@@ -1132,8 +1148,8 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
- v1 = &x[i] ;
- v2 = &x[j] ;
+ a=this->x[l] ;
-+ v1 = &(this->x)[i] ;
-+ v2 = &(this->x)[j] ;
++ v1 = &this->x[i] ;
++ v2 = &this->x[j] ;
while(1){
while(*v1 < a) { ++i ; ++v1 ; }
while(*v2 > a) { --j ; --v2 ; }
@@ -1207,33 +1223,9 @@ diff -ruh ./matrix/vector.cpp ./matrix/vector.cpp
break ;
swap(index[i],index[j]) ;
}
-diff -ruh ./matrix/vector_double.cpp ./matrix/vector_double.cpp
---- ./matrix/vector_double.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/vector_double.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
-
- namespace PLib {
-
-- void Vector<double>::qSortStd(){
-+ template<> void Vector<double>::qSortStd(){
- qsort((char*)memory(),n(),sizeof(float),compareDouble) ;
- }
-
-diff -ruh ./matrix/vector_float.cpp ./matrix/vector_float.cpp
---- ./matrix/vector_float.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/vector_float.cpp 2009-01-24 18:36:21.000000000 +1100
-@@ -27,7 +27,7 @@
-
- namespace PLib {
-
-- void Vector<float>::qSortStd(){
-+ template<> void Vector<float>::qSortStd(){
- qsort((char*)memory(),n(),sizeof(float),compareFloat) ;
- }
-
-diff -ruh ./matrix/vector.h ./matrix/vector.h
---- ./matrix/vector.h 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/vector.h 2009-01-24 18:36:21.000000000 +1100
+diff -r 8917adf507c7 matrix/vector.h
+--- matrix/vector.h Sun Jan 15 02:36:12 2012 +0000
++++matrix/vector.h Sun Jan 15 03:56:42 2012 +0000
@@ -69,7 +69,7 @@
{
public:
@@ -1243,21 +1235,53 @@ diff -ruh ./matrix/vector.h ./matrix/vector.h
Vector() : BasicArray<T>(1) {} //!< Basic constructor
Vector(const int r) : BasicArray<T>(r) {}
Vector(const Vector<T>& v) : BasicArray<T>(v) {}
-diff -ruh ./matrix/vector_int.cpp ./matrix/vector_int.cpp
---- ./matrix/vector_int.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./matrix/vector_int.cpp 2009-01-24 18:36:24.000000000 +1100
-@@ -27,7 +27,7 @@
+@@ -90,7 +90,7 @@
+ Vector<T> get(int i, int l);
+
+ int minIndex() const ;
+- T minimum() const { return operator[](minIndex()) ; } // returns the minimal value inside the vector
++ T minimum() const { return this->operator[](minIndex()) ; } // returns the minimal value inside the vector
+
+ void qSortStd() ;
+ void qSort(int M=7) ;
+diff -r 8917adf507c7 matrix/vector_double.cpp
+--- matrix/vector_double.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/vector_double.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -26,7 +26,8 @@
+ #include "vector.cpp"
namespace PLib {
+-
++
++ template<>
+ void Vector<double>::qSortStd(){
+ qsort((char*)memory(),n(),sizeof(float),compareDouble) ;
+ }
+diff -r 8917adf507c7 matrix/vector_float.cpp
+--- matrix/vector_float.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/vector_float.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
-- void Vector<int>::qSortStd(){
-+ template<> void Vector<int>::qSortStd(){
+ namespace PLib {
+
++ template<>
+ void Vector<float>::qSortStd(){
+ qsort((char*)memory(),n(),sizeof(float),compareFloat) ;
+ }
+diff -r 8917adf507c7 matrix/vector_int.cpp
+--- matrix/vector_int.cpp Sun Jan 15 02:36:12 2012 +0000
++++matrix/vector_int.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -27,6 +27,7 @@
+
+ namespace PLib {
+
++ template<>
+ void Vector<int>::qSortStd(){
qsort((char*)memory(),n(),sizeof(int),compareInt) ;
}
-
-diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
---- ./numerical/matrixMat.cpp 2002-05-14 07:07:45.000000000 +1000
-+++ ./numerical/matrixMat.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 numerical/matrixMat.cpp
+--- numerical/matrixMat.cpp Sun Jan 15 02:36:12 2012 +0000
++++numerical/matrixMat.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -48,9 +48,9 @@
template <class T>
LUMatrix<T>& LUMatrix<T>::operator=(const LUMatrix<T>& a){
@@ -1265,8 +1289,8 @@ diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
- for(int i=0;i<rows();++i)
- for(int j=0;j<cols();++j)
- elem(i,j) = a(i,j) ;
-+ for(int i=0;i<Matrix<T>::rows();++i)
-+ for(int j=0;j<Matrix<T>::cols();++j)
++ for(int i=0;i<this->rows();++i)
++ for(int j=0;j<this->cols();++j)
+ this->elem(i,j) = a(i,j) ;
pivot_ = a.pivot_ ;
return *this ;
@@ -1339,7 +1363,7 @@ diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
- for(int i=1;i<rows();++i)
- det *= elem(i,i) ;
+ T det = this->elem(0,0) ;
-+ for(int i=1;i<Matrix<T>::rows();++i)
++ for(int i=1;i<this->rows();++i)
+ det *= this->elem(i,i) ;
return det * (T)sign ;
}
@@ -1349,7 +1373,7 @@ diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
int i,ii,ip,j,k ;
T sum ;
- int n = rows() ;
-+ int n =Matrix<T>::rows() ;
++ int n = this->rows() ;
// one column at a time
//X.resize(n,B.cols()) ;
X = B ;
@@ -1362,35 +1386,37 @@ diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
else
if(sum)
ii=i ;
-@@ -230,7 +230,7 @@
+@@ -230,8 +230,8 @@
for(i=n-1;i>0;--i){ // doing forward substitution
sum=X(i,j) ;
for(k=i+1;k<n;++k)
- sum -= elem(i,k)*X(k,j) ;
+- X(i,j) = sum/elem(i,i) ;
+ sum -= this->elem(i,k)*X(k,j) ;
- X(i,j) = sum/elem(i,i) ;
++ X(i,j) = sum/this->elem(i,i) ;
}
}
+ }
@@ -253,18 +253,18 @@
T ten;
int i, j, k, l, kb, kp1, nm1, n, coln;
- if ( rows() != cols() )
-+ if (Matrix<T>::rows() !=Matrix<T>::cols() )
++ if ( this->rows() != this->cols() )
{
#ifdef USE_EXCEPTION
- throw WrongSize2D(rows(),cols(),0,0) ;
-+ throw WrongSize2D(Matrix<T>::rows(),Matrix<T>::cols(),0,0) ;
++ throw WrongSize2D(this->rows(),this->cols(),0,0) ;
#else
Error error("invm");
- error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
-+ error << "matrix inverse, not square: " <<Matrix<T>::rows() << " by " <<Matrix<T>::cols() << endl;
++ error << "matrix inverse, not square: " << this->rows() << " by " << this->cols() << endl;
error.fatal();
#endif
}
- n = coln = rows();
-+ n = coln =Matrix<T>::rows();
++ n = coln = this->rows();
inv = *this ;
@@ -1399,15 +1425,15 @@ diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
Matrix<T> LUMatrix<T>::inverse()
{
- if ( rows() != cols() )
-+ if (Matrix<T>::rows() !=Matrix<T>::cols() )
++ if ( this->rows() != this->cols() )
{
#ifdef USE_EXCEPTION
- throw WrongSize2D(rows(),cols(),0,0) ;
-+ throw WrongSize2D(Matrix<T>::rows(),Matrix<T>::cols(),0,0) ;
++ throw WrongSize2D(this->rows(),this->cols(),0,0) ;
#else
Error error("invm");
- error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
-+ error << "matrix inverse, not square: " <<Matrix<T>::rows() << " by " <<Matrix<T>::cols() << endl;
++ error << "matrix inverse, not square: " << this->rows() << " by " << this->cols() << endl;
error.fatal();
#endif
}
@@ -1420,9 +1446,9 @@ diff -ruh ./numerical/matrixMat.cpp ./numerical/matrixMat.cpp
err.warning() ;
#endif
return 0 ;
-diff -ruh ./nurbs/d_nurbs.cpp ./nurbs/d_nurbs.cpp
---- ./nurbs/d_nurbs.cpp 2002-05-14 06:11:57.000000000 +1000
-+++ ./nurbs/d_nurbs.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/d_nurbs.cpp
+--- nurbs/d_nurbs.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/d_nurbs.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -10,6 +10,7 @@
return firstDn(u) ;
}
@@ -1431,9 +1457,9 @@ diff -ruh ./nurbs/d_nurbs.cpp ./nurbs/d_nurbs.cpp
void NurbsCurve<double,2>::makeCircle(const Point_nD<double,2>& O, double r, double as, double ae){
makeCircle(O,Point_nD<double,2>(1,0),Point_nD<double,2>(0,1),r,as,ae) ;
}
-diff -ruh ./nurbs/d_nurbsSub.cpp ./nurbs/d_nurbsSub.cpp
---- ./nurbs/d_nurbsSub.cpp 2002-05-14 06:11:57.000000000 +1000
-+++ ./nurbs/d_nurbsSub.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/d_nurbsSub.cpp
+--- nurbs/d_nurbsSub.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/d_nurbsSub.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -14,8 +14,8 @@
template class RenderMeshPoints<double> ;
@@ -1445,9 +1471,9 @@ diff -ruh ./nurbs/d_nurbsSub.cpp ./nurbs/d_nurbsSub.cpp
template void DrawSubdivision( NurbSurface<double> *, double tolerance );
template void DrawEvaluation( NurbSurface<double> * );
-diff -ruh ./nurbs/d_surface.cpp ./nurbs/d_surface.cpp
---- ./nurbs/d_surface.cpp 2002-05-17 02:44:49.000000000 +1000
-+++ ./nurbs/d_surface.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/d_surface.cpp
+--- nurbs/d_surface.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/d_surface.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -25,6 +25,7 @@
template class InterPoint<double,2> ;
template class InterPoint<double,3> ;
@@ -1456,9 +1482,9 @@ diff -ruh ./nurbs/d_surface.cpp ./nurbs/d_surface.cpp
template class BasicList<InterPoint<double,2> > ;
template class BasicList<InterPoint<double,3> > ;
-diff -ruh ./nurbs/f_nurbsSub.cpp ./nurbs/f_nurbsSub.cpp
---- ./nurbs/f_nurbsSub.cpp 2002-05-14 06:11:57.000000000 +1000
-+++ ./nurbs/f_nurbsSub.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/f_nurbsSub.cpp
+--- nurbs/f_nurbsSub.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/f_nurbsSub.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -14,8 +14,8 @@
template class RenderMeshPoints<float> ;
@@ -1470,9 +1496,9 @@ diff -ruh ./nurbs/f_nurbsSub.cpp ./nurbs/f_nurbsSub.cpp
template void DrawSubdivision( NurbSurface<float> *, float tolerance );
template void DrawEvaluation( NurbSurface<float> * );
-diff -ruh ./nurbs/f_surface.cpp ./nurbs/f_surface.cpp
---- ./nurbs/f_surface.cpp 2002-05-17 02:44:49.000000000 +1000
-+++ ./nurbs/f_surface.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/f_surface.cpp
+--- nurbs/f_surface.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/f_surface.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -24,7 +24,9 @@
template class InterPoint<float,2> ;
@@ -1484,9 +1510,9 @@ diff -ruh ./nurbs/f_surface.cpp ./nurbs/f_surface.cpp
template class BasicList<InterPoint<float,2> > ;
template class BasicList<InterPoint<float,3> > ;
-diff -ruh ./nurbs/hnurbsS.cpp ./nurbs/hnurbsS.cpp
---- ./nurbs/hnurbsS.cpp 2002-05-18 04:24:21.000000000 +1000
-+++ ./nurbs/hnurbsS.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/hnurbsS.cpp
+--- nurbs/hnurbsS.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/hnurbsS.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -103,11 +103,11 @@
initBase() ;
offset.resize(baseSurf.ctrlPnts()) ;
@@ -1605,8 +1631,10 @@ diff -ruh ./nurbs/hnurbsS.cpp ./nurbs/hnurbsS.cpp
+ if(v<(this->knotV())[0] || v>(this->knotU())[(this->knotV()).n()-1])
return -1 ;
- int su = findSpanU(u) ;
- int sv = findSpanV(v) ;
+- int su = findSpanU(u) ;
+- int sv = findSpanV(v) ;
++ int su = this->findSpanU(u) ;
++ int sv = this->findSpanV(v) ;
- for(int i=0;i<=degU;++i)
- for(int j=0;j<=degV;++j){
@@ -1866,9 +1894,9 @@ diff -ruh ./nurbs/hnurbsS.cpp ./nurbs/hnurbsS.cpp
updateSurface() ;
return 1 ;
}
-diff -ruh ./nurbs/hnurbsS_sp.cpp ./nurbs/hnurbsS_sp.cpp
---- ./nurbs/hnurbsS_sp.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/hnurbsS_sp.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/hnurbsS_sp.cpp
+--- nurbs/hnurbsS_sp.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/hnurbsS_sp.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -43,7 +43,7 @@
*/
template <class T, int N>
@@ -1977,14 +2005,13 @@ diff -ruh ./nurbs/hnurbsS_sp.cpp ./nurbs/hnurbsS_sp.cpp
- sizeU = 2*degU+3 ;
- if(i-degU-1<0) sizeU += i-degU-1 ;
- if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
--
-- sizeV = 2*degV+3 ;
-- if(j-degV-1<0) sizeV += j-degV-1 ;
-- if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
+ sizeU = 2*this->degU+3 ;
+ if(i-this->degU-1<0) sizeU += i-this->degU-1 ;
+ if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
-+
+
+- sizeV = 2*degV+3 ;
+- if(j-degV-1<0) sizeV += j-degV-1 ;
+- if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
+ sizeV = 2*this->degV+3 ;
+ if(j-this->degV-1<0) sizeV += j-this->degV-1 ;
+ if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
@@ -2030,7 +2057,7 @@ diff -ruh ./nurbs/hnurbsS_sp.cpp ./nurbs/hnurbsS_sp.cpp
}
updateSurface();
}
-@@ -262,7 +263,7 @@
+@@ -262,12 +263,12 @@
HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel(int n, int s) {
HNurbsSurfaceSP<T,N> *newLevel ;
@@ -2039,6 +2066,12 @@ diff -ruh ./nurbs/hnurbsS_sp.cpp ./nurbs/hnurbsS_sp.cpp
return 0 ;
Vector<T> newU,newV ;
+
+- splitUV(n,s,n,s,newU,newV) ;
++ this->splitUV(n,s,n,s,newU,newV) ;
+
+ newLevel = new HNurbsSurfaceSP<T,N>(this,newU,newV) ;
+
@@ -289,7 +290,7 @@
HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel() {
HNurbsSurfaceSP<T,N> *newLevel ;
@@ -2276,9 +2309,25 @@ diff -ruh ./nurbs/hnurbsS_sp.cpp ./nurbs/hnurbsS_sp.cpp
this->updateSurface() ;
}
-diff -ruh ./nurbs/matrixRT.cpp ./nurbs/matrixRT.cpp
---- ./nurbs/matrixRT.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/matrixRT.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/hnurbsS_sp.h
+--- nurbs/hnurbsS_sp.h Sun Jan 15 02:36:12 2012 +0000
++++nurbs/hnurbsS_sp.h Sun Jan 15 03:56:42 2012 +0000
+@@ -83,10 +83,10 @@
+ T maxAtV(int i) const { return maxAtV_[i] ; }
+
+ HPoint_nD<T,N> surfP(int i,int j) const
+- { return hpointAt(maxAtU_[i],maxAtV_[j]); }
++ { return this->hpointAt(maxAtU_[i],maxAtV_[j]); }
+
+ HPoint_nD<T,N> surfP(int i,int j, int lod) const
+- { return hpointAt(maxAtU_[i],maxAtV_[j],lod) ; }
++ { return this->hpointAt(maxAtU_[i],maxAtV_[j],lod) ; }
+
+ void updateMaxUV()
+ { updateMaxU() ; updateMaxV() ; }
+diff -r 8917adf507c7 nurbs/matrixRT.cpp
+--- nurbs/matrixRT.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/matrixRT.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -51,13 +51,13 @@
// *this = C.translate(x,y,z)*B.rotate(ax,ay,az) ;
rotate(ax,ay,az) ;
@@ -2506,9 +2555,9 @@ diff -ruh ./nurbs/matrixRT.cpp ./nurbs/matrixRT.cpp
b = M.m - 1 ;
for(int i=0;i<16;++i){
*(++a) = *(++b) ;
-diff -ruh ./nurbs/nurbs.cpp ./nurbs/nurbs.cpp
---- ./nurbs/nurbs.cpp 2002-05-25 03:25:49.000000000 +1000
-+++ ./nurbs/nurbs.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/nurbs.cpp
+--- nurbs/nurbs.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbs.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -102,6 +102,7 @@
\author Philippe Lavoie
\date 24 January 1997
@@ -2848,6 +2897,15 @@ diff -ruh ./nurbs/nurbs.cpp ./nurbs/nurbs.cpp
template <class T, int N>
void NurbsCurve<T,N>::projectTo(const Point_nD<T,N>& p, T guess, T& u, Point_nD<T,N>& r, T e1, T e2,int maxTry) const{
T un ;
+@@ -2396,7 +2430,7 @@
+ r = c ;
+ return ;
+ }
+- c = pointAt(u) ;
++ c = this->pointAt(u) ;
+ deriveAt(u,2,Cd) ;
+ cd = Cd[1] ;
+ cdd = Cd[2] ;
@@ -2437,6 +2471,7 @@
\author Philippe Lavoie
\date 24 January, 1997
@@ -2984,9 +3042,32 @@ diff -ruh ./nurbs/nurbs.cpp ./nurbs/nurbs.cpp
template <class T, int N>
int NurbsCurve<T,N>::write(ofstream &fout) const {
if(!fout)
-diff -ruh ./nurbs/nurbsGL.cpp ./nurbs/nurbsGL.cpp
---- ./nurbs/nurbsGL.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/nurbsGL.cpp 2009-01-24 18:36:20.000000000 +1100
+@@ -5240,7 +5291,7 @@
+
+ for(i=0;i<n;++i){
+ u = (U[U.n()-deg_-1]-U[deg_])*T(i)/T(n-1) + U[deg_] ;
+- list.add(pointAt(u)) ;
++ list.add(this->pointAt(u)) ;
+ if(uk)
+ uk->add(u) ;
+ }
+diff -r 8917adf507c7 nurbs/nurbs.h
+--- nurbs/nurbs.h Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbs.h Sun Jan 15 03:56:42 2012 +0000
+@@ -105,8 +105,8 @@
+
+ // Basis functions
+ T basisFun(T u, int i, int p=-1) const ;
+- void basisFuns(T u, int span, Vector<T>& N) const ;
+- void dersBasisFuns(int n,T u, int span, Matrix<T>& N) const;
++ void basisFuns(T u, int span, Vector<T>& Nv) const ;
++ void dersBasisFuns(int n,T u, int span, Matrix<T>& Nv) const;
+
+ // Knot functions
+ T minKnot() const //! the minimal value for the knot vector
+diff -r 8917adf507c7 nurbs/nurbsGL.cpp
+--- nurbs/nurbsGL.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbsGL.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -26,7 +26,7 @@
#include <nurbsGL.h>
#include <string.h>
@@ -2996,6 +3077,15 @@ diff -ruh ./nurbs/nurbsGL.cpp ./nurbs/nurbsGL.cpp
#ifdef WITH_OPENGL
+@@ -1459,7 +1459,7 @@
+ NurbsGL* readNurbsObject(const char* filename) {
+ NurbsGL *temp ;
+ // guess the type of the curve first, if that doesn't work try all of them
+- char* ext ;
++ const char* ext ;
+ //ext = strstr(filename,".n()ca") ;
+ //if(ext){
+ // openByType = OPENCURVEARRAY ;
@@ -2590,7 +2590,7 @@
if(!fin)
return 0 ;
@@ -3016,22 +3106,25 @@ diff -ruh ./nurbs/nurbsGL.cpp ./nurbs/nurbsGL.cpp
-template class std::list<NurbsCurve_2Df*> ;
-template class std::list<NurbsCurve_2Df*>::iterator ;
+-
+-template class RenderMeshGL<float> ;
+//template class std::list<NurbsCurve_2Df*> ;
+//template class std::list<NurbsCurve_2Df*>::iterator ;
-
--template class RenderMeshGL<float> ;
++
+template class PLib::RenderMeshGL<float> ;
template class std::allocator<PLib::NurbsCurve<float, 2> *>;
-+template void std::_List_base<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_clear(void);
-
+-
-template void std::_List_base<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::clear(void);
-
-template void std::list<NurbsCurve_2Df*>::clear(void);
-+//template void std::list<NurbsCurve_2Df*>::clear(void);
-
+-
-template void std::list<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_insert_dispatch<std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *> >(std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *&, PLib::NurbsCurve<float, 2> **>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float,
-2> *const &, PLib::NurbsCurve<float, 2> *const *>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *>, __false_type);
++template void std::_List_base<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_clear(void);
++
++//template void std::list<NurbsCurve_2Df*>::clear(void);
++
+//template void std::list<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_insert_dispatch<std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *> >(std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *&, PLib::NurbsCurve<float, 2> **>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float,
+//2> *const &, PLib::NurbsCurve<float, 2> *const *>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *>, __false_type);
@@ -3046,9 +3139,9 @@ diff -ruh ./nurbs/nurbsGL.cpp ./nurbs/nurbsGL.cpp
#endif
-diff -ruh ./nurbs/nurbsS.cpp ./nurbs/nurbsS.cpp
---- ./nurbs/nurbsS.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/nurbsS.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/nurbsS.cpp
+--- nurbs/nurbsS.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbsS.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -3762,12 +3762,12 @@
// we use and angle of 36 to view the object
// and position the rest according to this.
@@ -3106,84 +3199,61 @@ diff -ruh ./nurbs/nurbsS.cpp ./nurbs/nurbsS.cpp
Point_nD<T,N> lookAt ;
lookAt.x() = (minP.x()+maxP.x())/2.0 ;
-diff -ruh ./nurbs/nurbs_sp.cpp ./nurbs/nurbs_sp.cpp
---- ./nurbs/nurbs_sp.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/nurbs_sp.cpp 2009-01-24 18:36:20.000000000 +1100
-@@ -41,7 +41,7 @@
- */
- template <class T, int N>
- void NurbsCurveSP<T,N>::updateMaxU() {
-- if(deg_>3){
-+ if(this->deg_>3){
- #ifdef USE_EXCEPTION
- throw NurbsInputError();
- #else
-@@ -51,10 +51,10 @@
- #endif
- }
- else{
-- maxU.resize(P.n()) ;
-- maxAt_.resize(P.n()) ;
-- for(int i=0;i<P.n();++i){
-- if(!maxInfluence(i,U,deg_,maxAt_[i]))
-+ maxU.resize(this->P.n()) ;
-+ maxAt_.resize(this->P.n()) ;
-+ for(int i=0;i<this->P.n();++i){
-+ if(!maxInfluence(i,this->U,this->deg_,maxAt_[i]))
- cerr << "Problem in maxInfluence U!\n" ;
- if(i>0)
- if(maxAt_[i]<maxAt_[i-1]){
-@@ -63,13 +63,13 @@
- #else
- Error error("Error updating maxU");
- error << "HUGE ERROR!\n" ;
-- error << "Knot = " << U << endl ;
-+ error << "Knot = " << this->U << endl ;
- error << " i = " << i << endl ;
-- error << " deg = " << deg_ << endl ;
-+ error << " this->deg = " << deg_ << endl ;
- error.fatal() ;
- #endif
- }
-- maxU[i] = basisFun(maxAt_[i],i,deg_) ;
-+ maxU[i] = basisFun(maxAt_[i],i,this->deg_) ;
+@@ -4082,7 +4082,7 @@
+
+ char front[1024] ;
+
+- char *ext ;
++ const char *ext ;
+ ext = strstr(filename,".rib") ;
+ if(ext){
+ for(i=0;i<1024;++i){
+@@ -4715,7 +4715,7 @@
+ T u,v;
+ for (u = fBu; u<fEu+fDu/2; u+=fDu)
+ for (v = fBv; v<fEv+fDv/2; v+=fDv){
+- Sp = pointAt(u,v);
++ Sp = this->pointAt(u,v);
+ Np = normal(u,v);
+ Np = (norm(Np)!=0)?Np.unitLength():Point_nD<T,N>(0.0);
+ fout << "\t" << Sp << "\t " << Np << endl;
+@@ -4829,7 +4829,7 @@
+ for (u = 0; u<1-fDu/2; u+=fDu){
+ // The change in sign and the swap of y and z coordinates is
+ // for conversion to MINC format.
+- Sp = -(T)1.0 * pointAt(u,v) ;
++ Sp = -(T)1.0 * this->pointAt(u,v) ;
+ fout << Sp.x() << ' ' << Sp.z() << ' ' << Sp.y() << endl;
}
-
- }
-@@ -96,14 +96,14 @@
- */
- template <class T, int N>
- void NurbsCurveSP<T,N>::modOnlySurfCPby(int i, const HPoint_nD<T,N>& a){
-- Vector<T> u(2*deg_+3) ;
-- Vector< Point_nD<T,N> > pts(2*deg_+3) ;
-+ Vector<T> u(2*this->deg_+3) ;
-+ Vector< Point_nD<T,N> > pts(2*this->deg_+3) ;
- int n=0;
-- for(int j=i-deg_-1;j<=i+deg_+1;++j){
-+ for(int j=i-this->deg_-1;j<=i+this->deg_+1;++j){
- if(j<0)
- continue ;
-- if(j>=P.n())
-+ if(j>=this->P.n())
- break ;
- u[n] = maxAt_[j] ;
- if( j == i){
-diff -ruh ./nurbs/nurbs_sp.h ./nurbs/nurbs_sp.h
---- ./nurbs/nurbs_sp.h 2002-05-18 04:24:21.000000000 +1000
-+++ ./nurbs/nurbs_sp.h 2009-01-24 18:36:20.000000000 +1100
-@@ -72,7 +72,7 @@
- int read(ifstream &fin) ;
-
- void modSurfCPby(int i, const HPoint_nD<T,N>& a)
-- { P[i] += a / maxU[i] ; }
-+ { this->P[i] += a / maxU[i] ; }
- void modSurfCP(int i, const HPoint_nD<T,N>& a)
- { modSurfCPby(i,a-surfP(i)) ; }
-
-diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
---- ./nurbs/nurbsS_sp.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/nurbsS_sp.cpp 2009-01-24 18:36:20.000000000 +1100
+diff -r 8917adf507c7 nurbs/nurbsS.h
+--- nurbs/nurbsS.h Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbsS.h Sun Jan 15 03:56:42 2012 +0000
+@@ -99,8 +99,8 @@
+ virtual HPoint_nD<T,N> operator()(T u, T v) const ;
+
+ void basisFuns(T u, T v, int spanU, int spanV, Vector<T>& Nu, Vector<T>& Nv) const ;
+- void basisFunsU(T u, int span, Vector<T>& N) const ;
+- void basisFunsV(T u, int span, Vector<T>& N) const ;
++ void basisFunsU(T u, int span, Vector<T>& Nv) const ;
++ void basisFunsV(T u, int span, Vector<T>& Nv) const ;
+ void dersBasisFuns(T u, T v, int dU, int dV,int uspan, int vspan,Matrix<T> & Niku, Matrix<T>& Njkv ) const ;
+
+ // Derivative functions
+@@ -135,8 +135,8 @@
+ int skinU(NurbsCurveArray<T,N>& ca, int degU);
+ void sweep(const NurbsCurve<T,N>& t, const NurbsCurve<T,N>& C, const NurbsCurve<T,N>& Sv, int K,int useAy=0, int invAz=0) ;
+ void sweep(const NurbsCurve<T,N>& t, const NurbsCurve<T,N>& C, int K,int useAy=0, int invAz=0) ;
+- void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& T, double theta) ;
+- void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& T) ;
++ void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& Ta, double theta) ;
++ void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& Ta) ;
+ void makeFromRevolution(const NurbsCurve<T,N>& profile) ;
+
+ void makeSphere(const Point_nD<T,N>& O, T r) ;
+diff -r 8917adf507c7 nurbs/nurbsS_sp.cpp
+--- nurbs/nurbsS_sp.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbsS_sp.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -43,7 +43,7 @@
*/
template <class T, int N>
@@ -3255,7 +3325,7 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
Du.reset(0) ;
Dv.reset(0) ;
-@@ -137,8 +137,8 @@
+@@ -137,10 +137,10 @@
no = 0 ;
@@ -3264,31 +3334,49 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
+ for(i=0;i<this->P.rows();++i)
+ for(j=0;j<this->P.cols();++j){
Point_nD<T,N> norm ;
- norm = normal(maxAtU_[i],maxAtV_[j]) ;
+- norm = normal(maxAtU_[i],maxAtV_[j]) ;
++ norm = this->normal(maxAtU_[i],maxAtV_[j]) ;
if(norm.x() == T(0) &&
-@@ -155,19 +155,19 @@
+ norm.y() == T(0) &&
+ norm.z() == T(0)){
+@@ -150,26 +150,26 @@
+ // must handle the corner cases
+ int ok = 0 ;
+ if(i==0 && j==0){
+- norm = normal(maxAtU_[i]+delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
++ norm = this->normal(maxAtU_[i]+delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]+delta) ;
norm /= T(2) ;
ok = 1 ;
}
- if(i==P.rows()-1 && j==P.cols()-1){
+- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]-delta) ;
+ if(i==this->P.rows()-1 && j==this->P.cols()-1){
- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
- norm += normal(maxAtU_[i],maxAtV_[j]-delta) ;
++ norm = this->normal(maxAtU_[i]-delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]-delta) ;
norm /= T(2) ;
ok = 1 ;
}
- if(i==0 && j==P.cols()-1){
+- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
+ if(i==0 && j==this->P.cols()-1){
- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
++ norm = this->normal(maxAtU_[i]-delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]+delta) ;
norm /= T(2) ;
ok = 1 ;
}
- if(i==P.rows()-1 && j==0){
+- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
+ if(i==this->P.rows()-1 && j==0){
- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
++ norm = this->normal(maxAtU_[i]-delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]+delta) ;
norm /= T(2) ;
+ ok = 1 ;
+ }
@@ -178,7 +178,7 @@
while(norm.x() == T(0) &&
norm.y() == T(0) &&
@@ -3298,7 +3386,7 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
#ifdef USE_EXCEPTION
throw NurbsComputationError();
#else
-@@ -188,12 +188,12 @@
+@@ -188,22 +188,22 @@
#endif
}
T u1,u2,v1,v2 ;
@@ -3309,12 +3397,15 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
v2 = maxAtV_[j]- nt*delta ;
- if(v1>V[V.n()-1]) v1 = V[V.n()-1] ;
- if(v2<V[0]) v2 = V[0] ;
+- norm = normal(u1,v1);
+- norm += normal(u2,v2) ;
+ if(v1>this->V[this->V.n()-1]) v1 = this->V[this->V.n()-1] ;
+ if(v2<this->V[0]) v2 = this->V[0] ;
- norm = normal(u1,v1);
- norm += normal(u2,v2) ;
++ norm = this->normal(u1,v1);
++ norm += this->normal(u2,v2) ;
norm /= 2 ;
-@@ -202,8 +202,8 @@
+ }
+ else{
u1 = maxAtU_[i]- nt*delta ;
u2 = maxAtU_[i]+ nt*delta ;
v1 = v2 = maxAtV_[j] ;
@@ -3325,7 +3416,7 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
T u3,v3 ;
u3 = maxAtU_[i] ;
-@@ -212,8 +212,8 @@
+@@ -212,12 +212,12 @@
else
v3 = maxAtV_[j]- nt*delta ;
@@ -3334,8 +3425,15 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
+ if(v3<this->V[0]) v3 = this->V[0] ;
+ if(v3>this->V[this->V.n()-1]) v3 = this->V[this->V.n()-1] ;
- norm = normal(u1,v1);
- norm += normal(u2,v2) ;
+- norm = normal(u1,v1);
+- norm += normal(u2,v2) ;
+- norm += normal(u3,v3) ;
++ norm = this->normal(u1,v1);
++ norm += this->normal(u2,v2) ;
++ norm += this->normal(u3,v3) ;
+ norm /= 3 ;
+ }
+ nt *= 10.0 ;
@@ -263,13 +263,13 @@
int sizeU, sizeV ;
@@ -3343,14 +3441,13 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
- sizeU = 2*degU+3 ;
- if(i-degU-1<0) sizeU += i-degU-1 ;
- if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
--
-- sizeV = 2*degV+3 ;
-- if(j-degV-1<0) sizeV += j-degV-1 ;
-- if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
+ sizeU = 2*this->degU+3 ;
+ if(i-this->degU-1<0) sizeU += i-this->degU-1 ;
+ if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
-+
+
+- sizeV = 2*degV+3 ;
+- if(j-degV-1<0) sizeV += j-degV-1 ;
+- if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
+ sizeV = 2*this->degV+3 ;
+ if(j-this->degV-1<0) sizeV += j-this->degV-1 ;
+ if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
@@ -3378,9 +3475,18 @@ diff -ruh ./nurbs/nurbsS_sp.cpp ./nurbs/nurbsS_sp.cpp
break ;
if( k == i && j==l){
pts[n].x() = a.x() ;
-diff -ruh ./nurbs/nurbsS_sp.h ./nurbs/nurbsS_sp.h
---- ./nurbs/nurbsS_sp.h 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/nurbsS_sp.h 2009-01-24 18:36:20.000000000 +1100
+@@ -316,7 +316,7 @@
+ pu.resize(n) ;
+ pv.resize(n) ;
+
+- movePoint(u,v,pts,pu,pv) ;
++ this->movePoint(u,v,pts,pu,pv) ;
+ }
+
+ } // end namespace
+diff -r 8917adf507c7 nurbs/nurbsS_sp.h
+--- nurbs/nurbsS_sp.h Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbsS_sp.h Sun Jan 15 03:56:42 2012 +0000
@@ -78,7 +78,7 @@
@@ -3390,9 +3496,18 @@ diff -ruh ./nurbs/nurbsS_sp.h ./nurbs/nurbsS_sp.h
void modSurfCP(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point to a value
{ modSurfCPby(i,j,a-surfP(i,j)) ; }
-diff -ruh ./nurbs/nurbsSub.cpp ./nurbs/nurbsSub.cpp
---- ./nurbs/nurbsSub.cpp 2002-05-14 07:07:46.000000000 +1000
-+++ ./nurbs/nurbsSub.cpp 2009-01-24 18:36:20.000000000 +1100
+@@ -94,7 +94,7 @@
+ { return maxAtV_[i] ; }
+
+ HPoint_nD<T,N> surfP(int i,int j) const //!< the surface point for the control point at i,j
+- { return hpointAt(maxAtU_[i],maxAtV_[j]); }
++ { return this->hpointAt(maxAtU_[i],maxAtV_[j]); }
+
+ void updateMaxUV() //!< Updates both the maxU and maxV values
+ { updateMaxU() ; updateMaxV() ; }
+diff -r 8917adf507c7 nurbs/nurbsSub.cpp
+--- nurbs/nurbsSub.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbsSub.cpp Sun Jan 15 03:56:42 2012 +0000
@@ -904,7 +904,7 @@
/* Allocate storage for the grid of points generated */
@@ -3411,3 +3526,126 @@ diff -ruh ./nurbs/nurbsSub.cpp ./nurbs/nurbsSub.cpp
for (i = 0; i <= k; i++)
CHECK( (*alpha)[i] = new T[(m + n + 1)]);
}
+diff -r 8917adf507c7 nurbs/nurbs_sp.cpp
+--- nurbs/nurbs_sp.cpp Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbs_sp.cpp Sun Jan 15 03:56:42 2012 +0000
+@@ -41,7 +41,7 @@
+ */
+ template <class T, int N>
+ void NurbsCurveSP<T,N>::updateMaxU() {
+- if(deg_>3){
++ if(this->deg_>3){
+ #ifdef USE_EXCEPTION
+ throw NurbsInputError();
+ #else
+@@ -51,10 +51,10 @@
+ #endif
+ }
+ else{
+- maxU.resize(P.n()) ;
+- maxAt_.resize(P.n()) ;
+- for(int i=0;i<P.n();++i){
+- if(!maxInfluence(i,U,deg_,maxAt_[i]))
++ maxU.resize(this->P.n()) ;
++ maxAt_.resize(this->P.n()) ;
++ for(int i=0;i<this->P.n();++i){
++ if(!maxInfluence(i,this->U,this->deg_,maxAt_[i]))
+ cerr << "Problem in maxInfluence U!\n" ;
+ if(i>0)
+ if(maxAt_[i]<maxAt_[i-1]){
+@@ -63,13 +63,13 @@
+ #else
+ Error error("Error updating maxU");
+ error << "HUGE ERROR!\n" ;
+- error << "Knot = " << U << endl ;
++ error << "Knot = " << this->U << endl ;
+ error << " i = " << i << endl ;
+- error << " deg = " << deg_ << endl ;
++ error << " this->deg = " << deg_ << endl ;
+ error.fatal() ;
+ #endif
+ }
+- maxU[i] = basisFun(maxAt_[i],i,deg_) ;
++ maxU[i] = this->basisFun(maxAt_[i],i,this->deg_) ;
+ }
+
+ }
+@@ -96,14 +96,14 @@
+ */
+ template <class T, int N>
+ void NurbsCurveSP<T,N>::modOnlySurfCPby(int i, const HPoint_nD<T,N>& a){
+- Vector<T> u(2*deg_+3) ;
+- Vector< Point_nD<T,N> > pts(2*deg_+3) ;
++ Vector<T> u(2*this->deg_+3) ;
++ Vector< Point_nD<T,N> > pts(2*this->deg_+3) ;
+
+ int n=0;
+- for(int j=i-deg_-1;j<=i+deg_+1;++j){
++ for(int j=i-this->deg_-1;j<=i+this->deg_+1;++j){
+ if(j<0)
+ continue ;
+- if(j>=P.n())
++ if(j>=this->P.n())
+ break ;
+ u[n] = maxAt_[j] ;
+ if( j == i){
+@@ -119,7 +119,7 @@
+ u.resize(n) ;
+ pts.resize(n) ;
+
+- movePoint(u,pts) ;
++ this->movePoint(u,pts) ;
+ }
+
+ } // end namespace
+diff -r 8917adf507c7 nurbs/nurbs_sp.h
+--- nurbs/nurbs_sp.h Sun Jan 15 02:36:12 2012 +0000
++++nurbs/nurbs_sp.h Sun Jan 15 03:56:42 2012 +0000
+@@ -72,7 +72,7 @@
+ int read(ifstream &fin) ;
+
+ void modSurfCPby(int i, const HPoint_nD<T,N>& a)
+- { P[i] += a / maxU[i] ; }
++ { this->P[i] += a / maxU[i] ; }
+ void modSurfCP(int i, const HPoint_nD<T,N>& a)
+ { modSurfCPby(i,a-surfP(i)) ; }
+
+@@ -84,7 +84,7 @@
+ { return maxAt_[i] ; }
+
+ HPoint_nD<T,N> surfP(int i) const
+- { return hpointAt(maxAt_[i]) ; }
++ { return this->hpointAt(maxAt_[i]) ; }
+
+ void updateMaxU() ;
+
+diff -r 26226c348ff0 matrix/matrix.cpp
+--- matrix/matrix.cpp Sun Dec 18 21:50:45 2011 +0000
++++ matrix/matrix.cpp Sun Dec 18 21:53:44 2011 +0000
+@@ -127,7 +127,7 @@
+ #ifdef COLUMN_ORDER
+ for ( i = a.rows()-1; i >= 0; --i )
+ for(j=a.cols()-1;j>=0;--j)
+- elem(i+rwz,j+coz) = a(i,j) ;
++ this->elem(i+rwz,j+coz) = a(i,j) ;
+ #else
+ T *ptr, *aptr ;
+ aptr = a.m - 1;
+@@ -172,7 +172,7 @@
+ #ifdef COLUMN_ORDER
+ for(i=0;i<a.rows();++i)
+ for(j=0;j<a.cols();++j)
+- elem(i+rw,j+cl) = a(i,j) ;
++ this->elem(i+rw,j+cl) = a(i,j) ;
+ #else
+ T *pptr,*aptr ;
+ aptr = a.m-1 ;
+@@ -223,7 +223,7 @@
+ #ifdef COLUMN_ORDER
+ for(i=0;i<nr;++i)
+ for(j=0;j<nc;++j)
+- getmat(i,j) = elem(i+rw,j+cl) ;
++ getmat(i,j) = this->elem(i+rw,j+cl) ;
+ #else
+ T *pptr,*aptr ;
+ aptr = getmat.m-1;
diff --git a/nurbs++.spec b/nurbs++.spec
index 0dc551d..e81e888 100644
--- a/nurbs++.spec
+++ b/nurbs++.spec
@@ -1,6 +1,6 @@
Name: nurbs++
Version: 3.0.11
-Release: 10%{?dist}
+Release: 11%{?dist}
Summary: Non Uniform Rational Basis Spline (NURBS) library for C++
Group: Development/Libraries
@@ -11,17 +11,13 @@ Source: http://downloads.sourceforge.net/libnurbs/%{name}-%{version}.tar.bz2
#Upstream maintenance request
#https://sourceforge.net/tracker/index.php?func=detail&aid=2531392&group_id=3254&atid=103254
-#Patch to fix gcc4.3 builds (template compliance problems)
-#Submitted to upstream tracker
-#https://sourceforge.net/tracker/index.php?func=detail&aid=2531330&group_id=3254&atid=303254
-Patch0: %{name}-gcc4.patch
+#Patch to fix up-to gcc4.7 builds
+Patch0: %{name}-gcc4.7.patch
#Patch to fix openGL lib finding.
Patch1: %{name}-opengl-config.patch
-#Patch to fix gcc4.4 builds (template parameter shadowing)
-Patch2: %{name}-gcc4.4.patch
#Patch to fix linker (non-weak symbols)
-Patch3: %{name}-linker.patch
+Patch2: %{name}-linker.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -57,7 +53,7 @@ Development libraries for the %{name} library.
%patch0
%patch1
%patch2
-%patch3
+
#Reconfigure to fix openGL test
autoreconf -f
#libtool provided is <1.5, which causes --tags to be not recognised
@@ -122,6 +118,9 @@ rm -rf %{buildroot}
%{_libdir}/libnurbsf.so
%changelog
+* Sun Jan 15 2012 <mycae(a!t)yahoo.com> 3.0.11-11
+- Update to fix FTBFS for gcc 4.7
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.11-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list