1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef bbs_APH_H 18 #define bbs_APH_H 19 20 /* ---- includes ----------------------------------------------------------- */ 21 22 #include "b_BasicEm/Context.h" 23 #include "b_BasicEm/Basic.h" 24 #include "b_BasicEm/Phase.h" 25 26 /* ---- related objects --------------------------------------------------- */ 27 28 struct bbs_Complex; 29 30 /* ---- typedefs ----------------------------------------------------------- */ 31 32 /* ---- constants ---------------------------------------------------------- */ 33 34 /* ---- object definition -------------------------------------------------- */ 35 36 /** Object representing absolute and phase value of a complex number */ 37 struct bbs_APh 38 { 39 40 /* ---- private data --------------------------------------------------- */ 41 42 /* ---- public data ---------------------------------------------------- */ 43 44 /** absolute value */ 45 uint16 absE; 46 47 /** phase value */ 48 phase16 phaseE; 49 50 }; 51 52 /* ---- associated objects ------------------------------------------------- */ 53 54 /* ---- external functions ------------------------------------------------- */ 55 56 /* ---- \ghd{ constructor/destructor } ------------------------------------- */ 57 58 /* ---- \ghd{ operators } -------------------------------------------------- */ 59 60 /** equal operator */ 61 flag bbs_APh_equal( struct bbs_APh aph1A, 62 struct bbs_APh aph2A ); 63 64 /* ---- \ghd{ query functions } -------------------------------------------- */ 65 66 /* ---- \ghd{ modify functions } ------------------------------------------- */ 67 68 /* ---- \ghd{ memory I/O } ------------------------------------------------- */ 69 70 /** size in 16-bit words object needs when written to memory */ 71 uint32 bbs_APh_memSize( struct bbs_Context* cpA, 72 struct bbs_APh aPhA ); 73 74 /** writes object to memory; returns number of 16-bit words written */ 75 uint32 bbs_APh_memWrite( struct bbs_Context* cpA, 76 const struct bbs_APh* ptrA, 77 uint16* memPtrA ); 78 79 /** reads object from memory; returns number of 16-bit words read */ 80 uint32 bbs_APh_memRead( struct bbs_Context* cpA, 81 struct bbs_APh* ptrA, 82 const uint16* memPtrA ); 83 84 /* ---- \ghd{ exec functions } --------------------------------------------- */ 85 86 /** conjugated value */ 87 struct bbs_APh bbs_APh_conj( const struct bbs_APh aPhA ); 88 89 /** imports complex value */ 90 void bbs_APh_importComplex( struct bbs_APh* dstPtrA, 91 const struct bbs_Complex* srcPtrA ); 92 93 /* ------------------------------------------------------------------------- */ 94 95 #endif /* bbs_APH_H */ 96