program too big to fit in memory ???
-
this code: define Bspline curve, when i run it, i found: "program too big to fit in memory" (although i restart computer) ??? #include "StdAfx.h" #include "process.h" #ifndef _MYBSPLINE_H__ #define _MYBSPLINE_H__ #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif typedef struct _MYPOINT { double x; double y; } MYPOINT; //---------------------------------------------------------------------------------------------------- class CMyBSpline { public: CMyBSpline(void); ~CMyBSpline(void); void SetDegree(int nK); // Thiet lap bac cua da thuc neu ban muon void Generate(MYPOINT* pControl, int n); // Thuc hien sinh cac diem dua tren cac diem dieu khien int GetPointNum(); // Tra ve so diem sinh ra MYPOINT* GetPoints(); // Tra ve con tro tro toi dau mang chua cac diem sinh private: MYPOINT* m_pPoints; // Mang chua cac diem B-Spline int m_nNum; // So diem tren B-Spline sinh ra int m_nK; // Bac cua da thuc int* m_pU; // Mang chua cac Knots void AllocateBSplinePoints(int n); // Cap phat vung nho luu tru diem tren B-Spline void FreeBSplinePoints(); // Giai phong vung nho luu tru diem tren B-Spline void AllocateKnot(int n); // Cap phat vung nho chua diem Knot void FreeKnot(); // Giap phong bo nho da cap phat de luu diem Knot void ComputeKnots(int n); // Tinh toan Knots double FactorN(int t, int k, double v); // Tinh he so da thuc Ni,k(u) void ComputeP(MYPOINT* pControl, int n, double u, MYPOINT& pt); // Tinh gia tri da thuc P(u) }; #endif CMyBSpline::CMyBSpline(void) { m_nK = 4; // Mac dinh m_pPoints = NULL; m_nNum = 0; m_pU = NULL; } CMyBSpline::~CMyBSpline(void) { FreeKnot(); FreeBSplinePoints(); } // Cap phat vung nho luu tru diem tren B-Spline // n: So diem can cap phat void CMyBSpline::AllocateBSplinePoints(int n) { if (m_pPoints!=NULL) FreeBSplinePoints(); m_pPoints = new MYPOINT[n]; m_nNum = n; } // Giai phong vung nho luu tru diem tren B-Spline void CMyBSpline::FreeBSplinePoints() { if (m_pPoints!=NULL) delete [] m_pPoints; m_pPoints = NULL; m_nNum = 0; } // Cap phat bo nho de luu diem Knot // n: So diem control point // So diem Knots la: n+m_nK+1 void CMyBSpline::AllocateKnot(int n) { if (m_pU!=NULL) FreeKnot(); m_pU = ne
-
this code: define Bspline curve, when i run it, i found: "program too big to fit in memory" (although i restart computer) ??? #include "StdAfx.h" #include "process.h" #ifndef _MYBSPLINE_H__ #define _MYBSPLINE_H__ #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif typedef struct _MYPOINT { double x; double y; } MYPOINT; //---------------------------------------------------------------------------------------------------- class CMyBSpline { public: CMyBSpline(void); ~CMyBSpline(void); void SetDegree(int nK); // Thiet lap bac cua da thuc neu ban muon void Generate(MYPOINT* pControl, int n); // Thuc hien sinh cac diem dua tren cac diem dieu khien int GetPointNum(); // Tra ve so diem sinh ra MYPOINT* GetPoints(); // Tra ve con tro tro toi dau mang chua cac diem sinh private: MYPOINT* m_pPoints; // Mang chua cac diem B-Spline int m_nNum; // So diem tren B-Spline sinh ra int m_nK; // Bac cua da thuc int* m_pU; // Mang chua cac Knots void AllocateBSplinePoints(int n); // Cap phat vung nho luu tru diem tren B-Spline void FreeBSplinePoints(); // Giai phong vung nho luu tru diem tren B-Spline void AllocateKnot(int n); // Cap phat vung nho chua diem Knot void FreeKnot(); // Giap phong bo nho da cap phat de luu diem Knot void ComputeKnots(int n); // Tinh toan Knots double FactorN(int t, int k, double v); // Tinh he so da thuc Ni,k(u) void ComputeP(MYPOINT* pControl, int n, double u, MYPOINT& pt); // Tinh gia tri da thuc P(u) }; #endif CMyBSpline::CMyBSpline(void) { m_nK = 4; // Mac dinh m_pPoints = NULL; m_nNum = 0; m_pU = NULL; } CMyBSpline::~CMyBSpline(void) { FreeKnot(); FreeBSplinePoints(); } // Cap phat vung nho luu tru diem tren B-Spline // n: So diem can cap phat void CMyBSpline::AllocateBSplinePoints(int n) { if (m_pPoints!=NULL) FreeBSplinePoints(); m_pPoints = new MYPOINT[n]; m_nNum = n; } // Giai phong vung nho luu tru diem tren B-Spline void CMyBSpline::FreeBSplinePoints() { if (m_pPoints!=NULL) delete [] m_pPoints; m_pPoints = NULL; m_nNum = 0; } // Cap phat bo nho de luu diem Knot // n: So diem control point // So diem Knots la: n+m_nK+1 void CMyBSpline::AllocateKnot(int n) { if (m_pU!=NULL) FreeKnot(); m_pU = ne
run a virus checker.
-
this code: define Bspline curve, when i run it, i found: "program too big to fit in memory" (although i restart computer) ??? #include "StdAfx.h" #include "process.h" #ifndef _MYBSPLINE_H__ #define _MYBSPLINE_H__ #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif typedef struct _MYPOINT { double x; double y; } MYPOINT; //---------------------------------------------------------------------------------------------------- class CMyBSpline { public: CMyBSpline(void); ~CMyBSpline(void); void SetDegree(int nK); // Thiet lap bac cua da thuc neu ban muon void Generate(MYPOINT* pControl, int n); // Thuc hien sinh cac diem dua tren cac diem dieu khien int GetPointNum(); // Tra ve so diem sinh ra MYPOINT* GetPoints(); // Tra ve con tro tro toi dau mang chua cac diem sinh private: MYPOINT* m_pPoints; // Mang chua cac diem B-Spline int m_nNum; // So diem tren B-Spline sinh ra int m_nK; // Bac cua da thuc int* m_pU; // Mang chua cac Knots void AllocateBSplinePoints(int n); // Cap phat vung nho luu tru diem tren B-Spline void FreeBSplinePoints(); // Giai phong vung nho luu tru diem tren B-Spline void AllocateKnot(int n); // Cap phat vung nho chua diem Knot void FreeKnot(); // Giap phong bo nho da cap phat de luu diem Knot void ComputeKnots(int n); // Tinh toan Knots double FactorN(int t, int k, double v); // Tinh he so da thuc Ni,k(u) void ComputeP(MYPOINT* pControl, int n, double u, MYPOINT& pt); // Tinh gia tri da thuc P(u) }; #endif CMyBSpline::CMyBSpline(void) { m_nK = 4; // Mac dinh m_pPoints = NULL; m_nNum = 0; m_pU = NULL; } CMyBSpline::~CMyBSpline(void) { FreeKnot(); FreeBSplinePoints(); } // Cap phat vung nho luu tru diem tren B-Spline // n: So diem can cap phat void CMyBSpline::AllocateBSplinePoints(int n) { if (m_pPoints!=NULL) FreeBSplinePoints(); m_pPoints = new MYPOINT[n]; m_nNum = n; } // Giai phong vung nho luu tru diem tren B-Spline void CMyBSpline::FreeBSplinePoints() { if (m_pPoints!=NULL) delete [] m_pPoints; m_pPoints = NULL; m_nNum = 0; } // Cap phat bo nho de luu diem Knot // n: So diem control point // So diem Knots la: n+m_nK+1 void CMyBSpline::AllocateKnot(int n) { if (m_pU!=NULL) FreeKnot(); m_pU = ne
Does this help?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Does this help?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
this code: define Bspline curve, when i run it, i found: "program too big to fit in memory" (although i restart computer) ??? #include "StdAfx.h" #include "process.h" #ifndef _MYBSPLINE_H__ #define _MYBSPLINE_H__ #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif typedef struct _MYPOINT { double x; double y; } MYPOINT; //---------------------------------------------------------------------------------------------------- class CMyBSpline { public: CMyBSpline(void); ~CMyBSpline(void); void SetDegree(int nK); // Thiet lap bac cua da thuc neu ban muon void Generate(MYPOINT* pControl, int n); // Thuc hien sinh cac diem dua tren cac diem dieu khien int GetPointNum(); // Tra ve so diem sinh ra MYPOINT* GetPoints(); // Tra ve con tro tro toi dau mang chua cac diem sinh private: MYPOINT* m_pPoints; // Mang chua cac diem B-Spline int m_nNum; // So diem tren B-Spline sinh ra int m_nK; // Bac cua da thuc int* m_pU; // Mang chua cac Knots void AllocateBSplinePoints(int n); // Cap phat vung nho luu tru diem tren B-Spline void FreeBSplinePoints(); // Giai phong vung nho luu tru diem tren B-Spline void AllocateKnot(int n); // Cap phat vung nho chua diem Knot void FreeKnot(); // Giap phong bo nho da cap phat de luu diem Knot void ComputeKnots(int n); // Tinh toan Knots double FactorN(int t, int k, double v); // Tinh he so da thuc Ni,k(u) void ComputeP(MYPOINT* pControl, int n, double u, MYPOINT& pt); // Tinh gia tri da thuc P(u) }; #endif CMyBSpline::CMyBSpline(void) { m_nK = 4; // Mac dinh m_pPoints = NULL; m_nNum = 0; m_pU = NULL; } CMyBSpline::~CMyBSpline(void) { FreeKnot(); FreeBSplinePoints(); } // Cap phat vung nho luu tru diem tren B-Spline // n: So diem can cap phat void CMyBSpline::AllocateBSplinePoints(int n) { if (m_pPoints!=NULL) FreeBSplinePoints(); m_pPoints = new MYPOINT[n]; m_nNum = n; } // Giai phong vung nho luu tru diem tren B-Spline void CMyBSpline::FreeBSplinePoints() { if (m_pPoints!=NULL) delete [] m_pPoints; m_pPoints = NULL; m_nNum = 0; } // Cap phat bo nho de luu diem Knot // n: So diem control point // So diem Knots la: n+m_nK+1 void CMyBSpline::AllocateKnot(int n) { if (m_pU!=NULL) FreeKnot(); m_pU = ne
lan sau post nho' them tag <pre></pre> truoc va sau dong code nhe, kho' nhin qua'
-
lan sau post nho' them tag <pre></pre> truoc va sau dong code nhe, kho' nhin qua'