- int base of the code
- int word length
- int cardinal of the code (number of words)
- 1 line for each vector. form --> ( int int int int int )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Reading Code from file
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
vec_ZZ_p io_read(list
{
FILE *f;//File to read From
int i,j;
char c;
if (( f = fopen(filepath, "r+")) == NULL )
{
perror("This file can not be opened\n");
}
fscanf(f, "%d\n",&base);
/////////////// Definition used for the list of vectors ///////////////////
ZZ p; //Modulus of the vector
p = base;
ZZ_p::init(p); //Ring/Field definition
vec_ZZ_p v; //vector used to compute Intersection Array over ZZ_p
///////////////////////////////////////////////////////////////////////////////////////////
fscanf(f, "%d\n",&wordlength);
fscanf(f, "%d\n",&codecardinal);
v.SetLength(wordlength);
for (i = 0;i < codecardinal;i++)
{
for (j = 0;j < wordlength;j++)
{
fseek(f,1,SEEK_CUR);// jump the blckspace and the "(" character
c = fgetc(f); // get the character we want
v[j] = c-ASCII_CONVERSION;
}
fseek(f,2,SEEK_CUR);// jump the last chars of the string
code.push_back(v);
}
fclose(f);
return v;
}
3 comentaris:
baby oil
pan
plate
rice ladle
bucket
glass
basin
powder
lotion
spoon
watch
shoe
slippers
tire
egg
hat
cigarette
hangers
veil
strange people
crazy
dish rack
helmets
doll
shampoo
soap
bread
cake
cheese
chicken
bra
shorts
bag
book
scissors
knife
towel
cable
roof tile
flower
balm
light
car
scissors
ashtray
fan
stove
sheath
broom
duster
cream ajaib
cream kuda hitam
suplemen herbal
cream ajaib
cream kuda hitam
I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information.
Publica un comentari a l'entrada