00001 /* 00002 * Author: Baldwin and Woolford 2008 00003 * Copyright (c) 2000-2006 Baylor College of Medicine 00004 * 00005 * This software is issued under a joint BSD/GNU license. You may use the 00006 * source code in this file under either license. However, note that the 00007 * complete EMAN2 and SPARX software packages have some GPL dependencies, 00008 * so you are responsible for compliance with the licenses of these packages 00009 * if you opt to use BSD licensing. The warranty disclaimer below holds 00010 * in either instance. 00011 * 00012 * This complete copyright notice must be included in any revised version of the 00013 * source code. Additional authorship citations may be added, but existing 00014 * author citations must be preserved. 00015 * 00016 * This program is free software; you can redistribute it and/or modify 00017 * it under the terms of the GNU General Public License as published by 00018 * the Free Software Foundation; either version 2 of the License, or 00019 * (at your option) any later version. 00020 * 00021 * This program is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00024 * GNU General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU General Public License 00027 * along with this program; if not, write to the Free Software 00028 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00029 * 00030 * */ 00031 00032 #include "emdata.h" 00033 #include "util.h" 00034 #include "transform.h" 00035 00036 using namespace EMAN; 00037 00038 #include <iostream> 00039 using std::cout; 00040 using std::endl; 00041 #include <boost/shared_ptr.hpp> 00042 using boost::shared_ptr; 00043 00044 void test_shared_pointer() { 00045 shared_ptr<Transform> p( new Transform); 00046 cout << p.use_count() << endl; 00047 Transform* t = p.get(); 00048 cout << p.use_count() << endl; 00049 shared_ptr<Transform> p2(p); 00050 cout << p.use_count() << endl; 00051 cout << p2.use_count() << endl; 00052 shared_ptr<Transform> p3 = p; 00053 cout << p.use_count() << endl; 00054 cout << p3.use_count() << endl; 00055 } 00056 00057 int main(int argc, char *argv[]) 00058 { 00059 // int nx = 64; 00060 // int P = (int)((1.0+0.25)*nx+1); 00061 // float r = (float)(nx+1)/(float)P; 00062 // int mFreqCutoff = 2; 00063 // float mDFreq = 0.2; 00064 00065 // float* W = Util::getBaldwinGridWeights(mFreqCutoff, P, r, mDFreq,0.5,0.2); 00066 // cout << "Test 2" << endl; 00067 // W = Util::getBaldwinGridWeights(3, 35, 0.9, 1,0.5,0.2); 00068 00069 test_shared_pointer(); 00070 // delete [] W; 00071 return 0; 00072 } 00073 00074 00075 00076