Click here to Skip to main content
15,888,527 members
Articles / Desktop Programming / Win32

Windows Development in C++, Working with Menus

Rate me:
Please Sign up or sign in to vote.
4.96/5 (60 votes)
3 Jan 2015CPOL19 min read 172.2K   4.1K   163  
Windows API, menus, C++ lambda expressions, std::enable_shared_from_this
/*
 * -- SuperLU MT routine (version 2.0) --
 * Lawrence Berkeley National Lab, Univ. of California Berkeley,
 * and Xerox Palo Alto Research Center.
 * September 10, 2007
 *
 * Sparse matrix types and function prototypes.
 *
 */

#ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */
#define __SUPERLU_sSP_DEFS

/*
 * File name:           pssp_defs.h
 * Purpose:             Sparse matrix types and function prototypes
 * History:
 */


#include "hnum_slucmn.h"

namespace harlinn
{
    namespace numerics
    {
        namespace SuperLU
        {
            namespace Single
            {
                typedef GlobalLU_T<float> GlobalLU_t;
                typedef pxgstrf_shared_T<GlobalLU_t> pxgstrf_shared_t;
                typedef pxgstrf_threadarg_T<pxgstrf_shared_t> psgstrf_threadarg_t;

                /* *********************
                   Function prototypes
                   *********************/

                /* ----------------
                   Driver routines 
                   ---------------*/
                void
                psgssv(int, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, 
                       SuperMatrix *, int *);
                void
                psgssvx(int, superlumt_options_t *, SuperMatrix *, int *, int *,  
	                equed_t *, float *, float *, SuperMatrix *, SuperMatrix *,
	                SuperMatrix *, SuperMatrix *, 
	                float *, float *, float *, float *, superlu_memusage_t *, 
	                int *);

                /* ---------------
                   Driver related 
                   ---------------*/
                void sgsequ (SuperMatrix *, float *, float *, float *,
                                    float *, float *, int *);
                void slaqgs (SuperMatrix *, float *, float *, float, 
		                    float, float, equed_t *);
                void sgscon (char *, SuperMatrix *, SuperMatrix *,
		                    float, float *, int *);
                float sPivotGrowth(int, SuperMatrix *, int *,
			                   SuperMatrix *, SuperMatrix *);
                void sgsrfs (trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *,
		                    int *, int *, equed_t, float *, float *, SuperMatrix *,
		                    SuperMatrix *, float *, float *, Gstat_t *, int *);
                int  sp_strsv (char *, char *, char *, SuperMatrix *, SuperMatrix *,
		                      float *, int *);
                int  sp_sgemv (char *, float, SuperMatrix *, float *,
		                      int, float, float *, int);
                int  sp_sgemm (char *, int, int, int, float, SuperMatrix *, 
		                      float *, int, float, float *, int);

                /* ----------------------
                   Factorization related
                   ----------------------*/

                void
                sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *,
		                      int *, int *, Stype_t, Dtype_t, Mtype_t);
                void
                sCreate_CompCol_Permuted(SuperMatrix *, int, int, int, float *, int *,
			                 int *, int *, Stype_t, Dtype_t, Mtype_t);
                void
                sCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
                void
                sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int,
		                     Stype_t, Dtype_t, Mtype_t);
                void
                sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *, int *, int *,
			                int *, int *, int *, Stype_t, Dtype_t, Mtype_t);
                void
                sCreate_SuperNode_Permuted(SuperMatrix *, int, int, int, float *, 
			                   int *, int *, int *, int *, int *, int *, 
			                   int *, int *, Stype_t, Dtype_t, Mtype_t);
                void
                sCopy_Dense_Matrix(int, int, float *, int, float *, int);


                void sallocateA (int, int, float **, int **, int **);
                void get_perm_c(int, SuperMatrix *, int *);
                void ssp_colorder (SuperMatrix *, int *, superlumt_options_t *,
			                 SuperMatrix *);
                int  sPresetMap (const int, SuperMatrix *, pxgstrf_relax_t *, 
		                       superlumt_options_t *, GlobalLU_t *);
                int  DynamicSetMap(const int, const int, const int, pxgstrf_shared_t*);
                void psgstrf (superlumt_options_t *, SuperMatrix *, int *, 
		                     SuperMatrix *, SuperMatrix *, Gstat_t *, int *);
                void psgstrf_init (int, fact_t, trans_t, yes_no_t, int, int, float, yes_no_t, double,
			                  int *, int *, void *, int, SuperMatrix *,
			                  SuperMatrix *, superlumt_options_t *, Gstat_t *);
                psgstrf_threadarg_t*
                psgstrf_thread_init (SuperMatrix *, SuperMatrix *, SuperMatrix *,
		                     superlumt_options_t*, pxgstrf_shared_t*, Gstat_t*, int*);
                void
                psgstrf_thread_finalize (psgstrf_threadarg_t *, pxgstrf_shared_t *,
			                 SuperMatrix *, int *, SuperMatrix *, SuperMatrix *);
                void psgstrf_finalize(superlumt_options_t *, SuperMatrix *);
                int
                psgstrf_factor_snode (const int, const int, SuperMatrix *, const float,
		                      yes_no_t *, int *, int *, int*, int*, int*, int*,
		                      float *, float *, pxgstrf_shared_t *, int *);
                void psgstrf_mark_busy_descends (int, int, int *, pxgstrf_shared_t *, int *, int *);
                int  psgstrf_snode_dfs (const int, const int, const int, const int *,
			                       const int *, const int *, int*, int *, int *,
			                       pxgstrf_shared_t *);
                int  psgstrf_snode_bmod (const int, const int, const int, const int,
				                float *, float *, GlobalLU_t*, Gstat_t*);
                void psgstrf_panel_dfs (const int, const int, const int, const int,
			                       SuperMatrix *, int*, int*, int*, int*, int*, 
			                       int*, int*, int*, int*, int*, int*, int*, int*,
			                       float*, GlobalLU_t *);
                void psgstrf_panel_bmod (const int, const int, const int, const int,
				                const int, int*, int*, int*, int*, int*, int*,
				                int*, int*, float*, float*, 
				                pxgstrf_shared_t *);
                void psgstrf_bmod1D (const int, const int, const int, const int, 
			                    const int, const int, const int, int, int,
			                    int *, int *, int *, int *, float *, float *, 
			                    GlobalLU_t *, Gstat_t *);
                void psgstrf_bmod2D (const int, const int, const int, const int,
			                    const int, const int, const int, int, int,
			                    int *, int *, int *, int *, float *, float *,
			                    GlobalLU_t *, Gstat_t *);
#ifndef _MSC_VER
                void psgstrf_bmod1D_mv2 (const int, const int, const int, const int, 
				                const int, const int, const int, int, int,
				                int *, int *, int *, int *, float *, 
				                float *, GlobalLU_t *, Gstat_t *);
                void psgstrf_bmod2D_mv2 (const int, const int, const int, const int,
				                const int, const int, const int, int, int,
				                int *, int *, int *, int *, float *, float *,
				                GlobalLU_t *, Gstat_t *);
#endif
                int  psgstrf_column_dfs(const int, const int, const int, const int,
			                       int*, int*, int*, int, int*, int*, int*, int*,
			                       int *, int *, int *, int *, pxgstrf_shared_t *);
                int  psgstrf_column_bmod(const int, const int, const int, const int, 
				                int*, int*, float*, float*,
				                pxgstrf_shared_t *, Gstat_t *);
                int  psgstrf_pivotL (const int, const int, const float, yes_no_t*,
			                    int*, int*, int*, int*, GlobalLU_t*, Gstat_t*);
                int  psgstrf_copy_to_ucol (const int, const int, const int, const int *,
				                  const int *, const int *, float*,
				                  pxgstrf_shared_t*);
                void psgstrf_pruneL (const int, const int *, const int, const int,
			                    const int *, const int *, int*, int *,
			                    GlobalLU_t *);
                void compressSUP (const int, GlobalLU_t *);
                void sreadmt (int *, int *, int *, float **, int **, int **);
                void sreadhb (int *, int *, int *, float **, int **, int **);
                void sGenXtrue (int, int, float *, int);
                void sFillRHS (trans_t, int, float *, int, 
		                      SuperMatrix *, SuperMatrix *);
                void sgstrs (trans_t, SuperMatrix *, SuperMatrix*, 
		                    int*, int*, SuperMatrix*, Gstat_t *, int *);

                /* ---------------
                   Memory related 
                   ---------------*/
                float psgstrf_MemInit (int, int, superlumt_options_t *,
			                SuperMatrix *, SuperMatrix *, GlobalLU_t *);
                float psgstrf_memory_use(const int, const int, const int);
                int  psgstrf_WorkInit (int, int, int **, float **);
                void psgstrf_SetRWork (int, int, float *, float **, float **);
                void psgstrf_WorkFree (int *, float *, GlobalLU_t *);
                int  psgstrf_MemXpand (int, int, MemType, int *, GlobalLU_t *);

                float *floatMalloc(int);
                float *floatCalloc(int);
                int  memory_usage ();
                int  superlu_sQuerySpace (int, SuperMatrix *, SuperMatrix *, int, 
				                 superlu_memusage_t *);
                int  Glu_alloc (const int, const int, const int, const MemType,
		                       int *, pxgstrf_shared_t *);

                /* -------------------
                   Auxiliary routines
                   -------------------*/
                
                void    sfill(float *, int, float);
                void    sinf_norm_error(int, SuperMatrix *, float *);
                void    snode_profile(int, int *);
                void    super_stats(int, int *, int *);
                void    panel_stats(int, int, int *, Gstat_t *);
                void    PrintSumm(char *, int, int, int);
                void    sPrintPerf(SuperMatrix *, SuperMatrix *, superlu_memusage_t *,
			                 float, float, float *, float *, char *,
			                 Gstat_t *);
                void    sCompRow_to_CompCol(int m, int n, int nnz, 
                                           float *a, int *colind, int *rowptr,
                                           float **at, int **rowind, int **colptr);


                /* -----------------------
                   Routines for debugging
                   -----------------------*/
                void    print_lu_col(int, char *, int, int, int, int *, GlobalLU_t *);
                void    print_panel_seg(int, int, int, int, int *, int *);
                void    scheck_zero_vec(int, char *, int, float *);
                void    check_repfnz(int, int, int, int *);


                void *psgstrf_thread(void *arg);

            };
        };
    };
};



#endif /* __SUPERLU_SSP_DEFS */

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Sea Surveillance AS
Norway Norway
Chief Architect - Sea Surveillance AS.

Specializing in integrated operations and high performance computing solutions.

I’ve been fooling around with computers since the early eighties, I’ve even done work on CP/M and MP/M.

Wrote my first “real” program on a BBC micro model B based on a series in a magazine at that time. It was fun and I got hooked on this thing called programming ...

A few Highlights:

  • High performance application server development
  • Model Driven Architecture and Code generators
  • Real-Time Distributed Solutions
  • C, C++, C#, Java, TSQL, PL/SQL, Delphi, ActionScript, Perl, Rexx
  • Microsoft SQL Server, Oracle RDBMS, IBM DB2, PostGreSQL
  • AMQP, Apache qpid, RabbitMQ, Microsoft Message Queuing, IBM WebSphereMQ, Oracle TuxidoMQ
  • Oracle WebLogic, IBM WebSphere
  • Corba, COM, DCE, WCF
  • AspenTech InfoPlus.21(IP21), OsiSoft PI


More information about what I do for a living can be found at: harlinn.com or LinkedIn

You can contact me at espen@harlinn.no

Comments and Discussions