Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Common - Math API [Vector].inl
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_COMMON_MATH_API_VECTOR_INL)
#define TGS_COMMON_MATH_API_VECTOR_INL
#pragma once


/* == Common ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Native Vector Type and Files for Platform definition */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* F32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [F32_04].i_inc" */
/* U08_16 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* U08_16 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc" */
/* U16_08 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* U16_08 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc" */
/* U32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* U32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc" */
/* S08_16 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* S08_16 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc" */
/* S16_08 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* S16_08 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc" */
/* S32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* S32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc" */
/* F32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc" */
/* F32_04 #include "TgS COMMON/TgS Common - Math API [Vector] [M] [F].i_inc" */


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Functions                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

#define VEC_02_ASSIGN_EQN                           \
    V(TgVEC)                            vResult;   \
    vResult.m_aData[ 0] = EQN( 0);                 \
    vResult.m_aData[ 1] = EQN( 1);                 \
    return (vResult);

#define VEC_03_ASSIGN_EQN                           \
    V(TgVEC)                            vResult;   \
    vResult.m_aData[ 0] = EQN( 0);                 \
    vResult.m_aData[ 1] = EQN( 1);                 \
    vResult.m_aData[ 2] = EQN( 2);                 \
    return (vResult);

#define VEC_04_ASSIGN_EQN                           \
    V(TgVEC)                            vResult;   \
    vResult.m_aData[ 0] = EQN( 0);                 \
    vResult.m_aData[ 1] = EQN( 1);                 \
    vResult.m_aData[ 2] = EQN( 2);                 \
    vResult.m_aData[ 3] = EQN( 3);                 \
    return (vResult);

#define VEC_08_ASSIGN_EQN                           \
    V(TgVEC)                            vResult;   \
    vResult.m_aData[ 0] = EQN( 0);                 \
    vResult.m_aData[ 1] = EQN( 1);                 \
    vResult.m_aData[ 2] = EQN( 2);                 \
    vResult.m_aData[ 3] = EQN( 3);                 \
    vResult.m_aData[ 4] = EQN( 4);                 \
    vResult.m_aData[ 5] = EQN( 5);                 \
    vResult.m_aData[ 6] = EQN( 6);                 \
    vResult.m_aData[ 7] = EQN( 7);                 \
    return (vResult);

#define VEC_16_ASSIGN_EQN                           \
    V(TgVEC)                            vResult;   \
    vResult.m_aData[ 0] = EQN( 0);                 \
    vResult.m_aData[ 1] = EQN( 1);                 \
    vResult.m_aData[ 2] = EQN( 2);                 \
    vResult.m_aData[ 3] = EQN( 3);                 \
    vResult.m_aData[ 4] = EQN( 4);                 \
    vResult.m_aData[ 5] = EQN( 5);                 \
    vResult.m_aData[ 6] = EQN( 6);                 \
    vResult.m_aData[ 7] = EQN( 7);                 \
    vResult.m_aData[ 8] = EQN( 8);                 \
    vResult.m_aData[ 9] = EQN( 9);                 \
    vResult.m_aData[10] = EQN(10);                 \
    vResult.m_aData[11] = EQN(11);                 \
    vResult.m_aData[12] = EQN(12);                 \
    vResult.m_aData[13] = EQN(13);                 \
    vResult.m_aData[14] = EQN(14);                 \
    vResult.m_aData[15] = EQN(15);                 \
    return (vResult);

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_16_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U08
#define TYPE TgUINT08
#define V(A) A##_U08_16
#define T(A) A##_U08
#define DIM 16
#define TYPE_SIZE 1
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_08_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U16
#define TYPE TgUINT16
#define V(A) A##_U16_08
#define T(A) A##_U16
#define DIM 8
#define TYPE_SIZE 2
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U32
#define TYPE TgUINT32
#define V(A) A##_U32_04
#define T(A) A##_U32
#define DIM 4
#define TYPE_SIZE 4
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_16_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U08
#define TYPE TgSINT08
#define V(A) A##_S08_16
#define T(A) A##_S08
#define DIM 16
#define TYPE_SIZE 1
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_08_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U16
#define TYPE TgSINT16
#define V(A) A##_S16_08
#define T(A) A##_S16
#define DIM 8
#define TYPE_SIZE 2
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK (TgSINT32)KTgMAX_U32
#define TYPE TgSINT32
#define V(A) A##_S32_04
#define T(A) A##_S32
#define DIM 4
#define TYPE_SIZE 4
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [I].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK KTgMASK_TRUE.m_f32
#define PCU_TYPE TgFLOAT32 * __restrict const
#define TYPE TgFLOAT32
#define F(A) A##_F32
#define V(A) A##_F32_04
#define MKL(A) A##F
#define M34(A) A##_F32_34
#define T(A) A##_F32
#define DIM 4
#define TYPE_SIZE 4
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [F].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [FXX_04].i_inc"
#if !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL)
#include "TgS COMMON/TgS Common - Math API [Vector] [M].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [F].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [M] [F32_04].i_inc"
/*# !defined(TGS_COMMON_MATH_VECTOR_SPECIALIZATION) && !defined(TGS_COMMON_MATH_API_VECTOR_SPECIALIZATION_INL) */
#endif
#undef TYPE_SIZE
#undef DIM
#undef T
#undef M34
#undef MKL
#undef V
#undef F
#undef TYPE
#undef PCU_TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U08
#define TYPE TgUINT08
#define V(A) A##_U08_04
#define T(A) A##_U08
#define DIM 4
#define TYPE_SIZE 1
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_02_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U16
#define TYPE TgUINT16
#define V(A) A##_U16_02
#define T(A) A##_U16
#define DIM 2
#define TYPE_SIZE 2
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK KTgMAX_U64
#define TYPE TgUINT64
#define V(A) A##_U64_04
#define T(A) A##_U64
#define DIM 4
#define TYPE_SIZE 8
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK (TgSINT64)KTgMAX_U64
#define TYPE TgSINT64
#define V(A) A##_S64_04
#define T(A) A##_S64
#define DIM 4
#define TYPE_SIZE 8
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [I].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_02_ASSIGN_EQN
#define TYPE_MASK KTgMASK_TRUE.m_f32
#define TYPE TgFLOAT32
#define V(A) A##_F32_02
#define T(A) A##_F32
#define MKL(A) A##F
#define DIM 2
#define TYPE_SIZE 4
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [F].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef MKL
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_03_ASSIGN_EQN
#define TYPE_MASK KTgMASK_TRUE.m_f32
#define TYPE TgFLOAT32
#define V(A) A##_F32_03
#define T(A) A##_F32
#define MKL(A) A##F
#define DIM 3
#define TYPE_SIZE 4
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [F].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef MKL
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_02_ASSIGN_EQN
#define TYPE_MASK KTgMASK_TRUE.m_f64
#define TYPE TgFLOAT64
#define V(A) A##_F64_02
#define T(A) A##_F64
#define MKL(A) A
#define DIM 2
#define TYPE_SIZE 8
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [F].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef MKL
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_03_ASSIGN_EQN
#define TYPE_MASK KTgMASK_TRUE.m_f64
#define TYPE TgFLOAT64
#define V(A) A##_F64_03
#define T(A) A##_F64
#define MKL(A) A
#define DIM 3
#define TYPE_SIZE 8
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [F].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef MKL
#undef T
#undef V
#undef TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

#define VEC_ASSIGN_EQN VEC_04_ASSIGN_EQN
#define TYPE_MASK KTgMASK_TRUE.m_f64
#define PCU_TYPE TgFLOAT64 * __restrict const
#define TYPE TgFLOAT64
#define F(A) A##_F64
#define V(A) A##_F64_04
#define MKL(A) A
#define M34(A) A##_F64_34
#define T(A) A##_F64
#define DIM 4
#define TYPE_SIZE 8
#include "TgS COMMON/TgS Common - Math API [Vector].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [F].i_inc"
#include "TgS COMMON/TgS Common - Math API [Vector] [FXX_04].i_inc"
#undef TYPE_SIZE
#undef DIM
#undef T
#undef M34
#undef MKL
#undef V
#undef F
#undef TYPE
#undef PCU_TYPE
#undef TYPE_MASK
#undef VEC_ASSIGN_EQN

/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */

/* ====================================================================================================================================================================== */
#endif