polylib: vector.h Source File

- Main Page
- Classes
- Files

# vector.h

Go to the documentation of this file.

    00001 #ifndef _vector_H_
    00002 #define _vector_H_
    00003
    00004 #if defined(__cplusplus)
    00005 extern "C" {
    00006 #endif
    00007
    00008 int ConstraintSimplify(Value *old, Value *n, int len, Value* v);
    00009 Value* value_alloc(int want, int *got);
    00010 void value_free(Value *p, int size);
    00011
    00012 extern void Factorial(int n,Value *result);
    00013 extern void Binomial(int n,int p,Value *result);
    00014 extern void CNP(int a,int b,Value *result);
    00015 extern void Gcd(Value a,Value b,Value *result);
    00016 extern int First_Non_Zero(Value *p, unsigned length);
    00017 extern Vector *Vector_Alloc(unsigned length);
    00018 extern void Vector_Free(Vector *vector);
    00019 extern void  Vector_Print(FILE *Dst, const char *Format, Vector *Vec);
    00020 extern Vector *Vector_Read(void);
    00021 extern void Vector_Set(Value *p,int n,unsigned length);
    00022 extern void Vector_Exchange(Value *p1, Value *p2, unsigned length);
    00023 extern void Vector_Copy(Value *p1, Value *p2, unsigned length);
    00024 extern void Vector_Add(Value *p1,Value *p2,Value *p3,unsigned length);
    00025 extern void Vector_Sub(Value *p1,Value *p2,Value *p3,unsigned length);
    00026 extern void Vector_Or(Value *p1,Value *p2,Value *p3,unsigned length);
    00027 extern void Vector_Scale(Value *p1, Value *p2, Value lambda, unsigned
    00028                          length);
    00029 extern void Vector_AntiScale(Value *p1,Value *p2,Value lambda,
    00030                                         unsigned length);
    00031 extern void Vector_Oppose(Value *p1, Value *p2, unsigned length);
    00032 extern void Inner_Product(Value *p1,Value *p2,unsigned length, Value *result);
    00033 extern void Vector_Max(Value *p,unsigned length, Value *result);
    00034 extern void Vector_Min(Value *p,unsigned length, Value *result);
    00035 extern void Vector_Combine(Value *p1,Value *p2,Value *p3,Value
    00036                             lambda, Value mu, unsigned length);
    00037 extern int  Vector_Equal(Value *Vec1,Value *Vec2,unsigned n);
    00038 extern void Vector_Min_Not_Zero(Value *p,unsigned length,int *index,Value
    00039                      *result);
    00040 extern void Vector_Gcd(Value *p,unsigned length,Value *result);
    00041 extern void Vector_Map(Value *p1,Value *p2,Value *p3,unsigned
    00042                        length, Value *(*f)(Value,Value));
    00043 extern void Vector_Normalize(Value *p,unsigned length);
    00044 extern void Vector_Normalize_Positive(Value *p,int length,
    00045                                       int pos);
    00046 extern void Vector_Reduce(Value *p,unsigned length,
    00047                   void(*f)(Value,Value *),Value *result);
    00048 extern void Vector_Sort(Value *vector,unsigned n);
    00049 extern int Vector_IsZero(Value * v, unsigned length);
    00050
    00051 #if defined(__cplusplus)
    00052 }
    00053 #endif
    00054
    00055 #endif /* _vector_H_ */