tfindbestsq.cpp

00001 /*************************************************************************************
00002  * MechSys - A C++ library to simulate (Continuum) Mechanical Systems                *
00003  * Copyright (C) 2005 Dorival de Moraes Pedroso <dorival.pedroso at gmail.com>       *
00004  * Copyright (C) 2005 Raul Dario Durand Farfan  <raul.durand at gmail.com>           *
00005  *                                                                                   *
00006  * This file is part of MechSys.                                                     *
00007  *                                                                                   *
00008  * MechSys is free software; you can redistribute it and/or modify it under the      *
00009  * terms of the GNU General Public License as published by the Free Software         *
00010  * Foundation; either version 2 of the License, or (at your option) any later        *
00011  * version.                                                                          *
00012  *                                                                                   *
00013  * MechSys is distributed in the hope that it will be useful, but WITHOUT ANY        *
00014  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A   *
00015  * PARTICULAR PURPOSE. See the GNU General Public License for more details.          *
00016  *                                                                                   *
00017  * You should have received a copy of the GNU General Public License along with      *
00018  * MechSys; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, *
00019  * Fifth Floor, Boston, MA 02110-1301, USA                                           *
00020  *************************************************************************************/
00021 
00022 // STL
00023 #include <iostream>
00024 
00025 // MechSys
00026 #include "util/util.h"
00027 #include "util/numstreams.h"
00028 
00029 using std::cout;
00030 using std::endl;
00031 using Util::_4;
00032 
00033 int main(int argc, char **argv)
00034 {
00035     // Find best squared grid
00036     const int MAX_SIZE = 100;
00037     for (int i=1; i<=MAX_SIZE; ++i)
00038     {
00039         int nrow = -1;
00040         int ncol = -1;
00041         Util::FindBestSquare(i, nrow,ncol);
00042         cout << _4()<< nrow << _4()<< ncol << _4()<< nrow*ncol << endl;
00043     }
00044 
00045     return 0;
00046 }

Generated on Wed Jan 24 15:56:27 2007 for MechSys by  doxygen 1.4.7