Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. program too big to fit in memory ???

program too big to fit in memory ???

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a04 lqd
    wrote on last edited by
    #1

    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

    C D P 3 Replies Last reply
    0
    • A a04 lqd

      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

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      run a virus checker.

      image processing toolkits | batch image processing

      1 Reply Last reply
      0
      • A a04 lqd

        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

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        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

        A 1 Reply Last reply
        0
        • D David Crow

          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

          A Offline
          A Offline
          a04 lqd
          wrote on last edited by
          #4

          thank u i run another code and it run normaly. only this code has " program too big to fit in memory "

          1 Reply Last reply
          0
          • A a04 lqd

            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

            P Offline
            P Offline
            PCuong1983
            wrote on last edited by
            #5

            lan sau post nho' them tag <pre></pre> truoc va sau dong code nhe, kho' nhin qua'

            A 1 Reply Last reply
            0
            • P PCuong1983

              lan sau post nho' them tag <pre></pre> truoc va sau dong code nhe, kho' nhin qua'

              A Offline
              A Offline
              a04 lqd
              wrote on last edited by
              #6

              ^^ em moi tap code thoi, anh thong cam... :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups