Exemplo n.º 1
0
inline void
LocalTrrkKernel
( UpperOrLower uplo,
  Orientation orientationOfA,
  Orientation orientationOfB,
  T alpha, const DistMatrix<T,STAR,MC  >& A,
           const DistMatrix<T,MR,  STAR>& B,
  T beta,        DistMatrix<T,MC,  MR  >& C )
{
#ifndef RELEASE
    PushCallStack("LocalTrrkKernel");
    CheckInput( orientationOfA, orientationOfB, A, B, C );
#endif
    const Grid& g = C.Grid();

    DistMatrix<T,STAR,MC> AL(g), AR(g);
    DistMatrix<T,MR,STAR> BT(g), 
                          BB(g);
    DistMatrix<T,MC,MR> CTL(g), CTR(g),
                        CBL(g), CBR(g);
    DistMatrix<T,MC,MR> DTL(g), DBR(g);

    const int half = C.Height()/2;
    ScaleTrapezoid( beta, LEFT, uplo, 0, C );
    LockedPartitionRight( A, AL, AR, half );
    LockedPartitionDown
    ( B, BT, 
         BB, half );
    PartitionDownDiagonal
    ( C, CTL, CTR,
         CBL, CBR, half );

    DTL.AlignWith( CTL );
    DBR.AlignWith( CBR );
    DTL.ResizeTo( CTL.Height(), CTL.Width() );
    DBR.ResizeTo( CBR.Height(), CBR.Width() );
    //------------------------------------------------------------------------//
    if( uplo == LOWER )
        internal::LocalGemm
        ( orientationOfA, orientationOfB, alpha, AR, BT, T(1), CBL );
    else
        internal::LocalGemm
        ( orientationOfA, orientationOfB, alpha, AL, BB, T(1), CTR );

    internal::LocalGemm
    ( orientationOfA, orientationOfB, alpha, AL, BT, T(0), DTL );
    AxpyTriangle( uplo, T(1), DTL, CTL );

    internal::LocalGemm
    ( orientationOfA, orientationOfB, alpha, AR, BB, T(0), DBR );
    AxpyTriangle( uplo, T(1), DBR, CBR );
    //------------------------------------------------------------------------//
#ifndef RELEASE
    PopCallStack();
#endif
}
Exemplo n.º 2
0
// Unicode support by Jim Park -- 08/23/2007

#include <windows.h>
#include <commctrl.h>
#include "../ExDLL/nsis_tchar.h"
#include "resource.h"

#define CBL(x) {x,_T(#x)}

struct line {
	unsigned short id;
	const TCHAR *name;
};

line primary[] = {
	CBL(LANG_NEUTRAL),
	CBL(LANG_INVARIANT),
	CBL(LANG_AFRIKAANS),
	CBL(LANG_ALBANIAN),
	CBL(LANG_ARABIC),
	CBL(LANG_ARMENIAN),
	CBL(LANG_ASSAMESE),
	CBL(LANG_AZERI),
	CBL(LANG_BASQUE),
	CBL(LANG_BELARUSIAN),
	CBL(LANG_BENGALI),
	CBL(LANG_BULGARIAN),
	CBL(LANG_CATALAN),
	CBL(LANG_CHINESE),
	CBL(LANG_CROATIAN),
	CBL(LANG_CZECH),
Exemplo n.º 3
0
qboolean G2_SetRootSurface(CGhoul2Info_v &ghoul2, const int modelIndex, const char *surfaceName)
{
	int					surf;
	int					flags;
	int					*activeSurfaces, *activeBones;

	assert(ghoul2[modelIndex].currentModel && ghoul2[modelIndex].animModel);

	model_t				*mod_m = (model_t *)ghoul2[modelIndex].currentModel;
	model_t				*mod_a = (model_t *)ghoul2[modelIndex].animModel;

	// did we find a ghoul 2 model or not?
	if (!mod_m->mdxm)
	{
		return qfalse;
	}

	// first find if we already have this surface in the list
	surf = G2_IsSurfaceLegal(mod_m, surfaceName, &flags);
	if (surf != -1)
	{
		// first see if this ghoul2 model already has this as a root surface
		if (ghoul2[modelIndex].mSurfaceRoot == surf)
		{
			return qtrue;
		}

		// set the root surface
		ghoul2[modelIndex].mSurfaceRoot = surf;

		// ok, now the tricky bits.
		// firstly, generate a list of active / on surfaces below the root point

		// gimme some space to put this list into
		activeSurfaces = (int *)Z_Malloc(mod_m->mdxm->numSurfaces * 4, TAG_GHOUL2, qtrue);
		memset(activeSurfaces, 0, (mod_m->mdxm->numSurfaces * 4));
		activeBones = (int *)Z_Malloc(mod_a->mdxa->numBones * 4, TAG_GHOUL2, qtrue);
		memset(activeBones, 0, (mod_a->mdxa->numBones * 4));

		G2_FindRecursiveSurface(mod_m, surf, ghoul2[modelIndex].mSlist, activeSurfaces);

		// now generate the used bone list
		CConstructBoneList	CBL(ghoul2[modelIndex].mSurfaceRoot, 
							activeBones,
							ghoul2[modelIndex].mSlist,
							mod_m,
							ghoul2[modelIndex].mBlist);

		G2_ConstructUsedBoneList(CBL);

		// now remove all procedural or override surfaces that refer to surfaces that arent on this list
		G2_RemoveRedundantGeneratedSurfaces(ghoul2[modelIndex].mSlist, activeSurfaces);

		// now remove all bones that are pointing at bones that aren't active
		G2_RemoveRedundantBoneOverrides(ghoul2[modelIndex].mBlist, activeBones);

		// then remove all bolts that point at surfaces or bones that *arent* active.
		G2_RemoveRedundantBolts(ghoul2[modelIndex].mBltlist, ghoul2[modelIndex].mSlist, activeSurfaces, activeBones);

		// then remove all models on this ghoul2 instance that use those bolts that are being removed.
		for (int i=0; i<ghoul2.size(); i++)
		{
			// are we even bolted to anything?
			if (ghoul2[i].mModelBoltLink != -1)
			{
				int	boltMod = (ghoul2[i].mModelBoltLink >> MODEL_SHIFT) & MODEL_AND;
				int	boltNum = (ghoul2[i].mModelBoltLink >> BOLT_SHIFT) & BOLT_AND;
				// if either the bolt list is too small, or the bolt we are pointing at references nothing, remove this model
				if (((int)ghoul2[boltMod].mBltlist.size() <= boltNum) || 
					((ghoul2[boltMod].mBltlist[boltNum].boneNumber == -1) && 
					 (ghoul2[boltMod].mBltlist[boltNum].surfaceNumber == -1)))
				{
					CGhoul2Info_v *g2i = &ghoul2;
					G2API_RemoveGhoul2Model((CGhoul2Info_v **)&g2i, i);
				}
			}
		}
		//No support for this, for now.

		// remember to free what we used
		Z_Free(activeSurfaces);
		Z_Free(activeBones);

		return (qtrue);
	}