Skip to content
Snippets Groups Projects
Select Git revision
  • c5d30ba76175d609c250b6632efc40ace3ba8a5b
  • master default protected
  • array_3d
  • gradients
  • poylgonise
  • apps
  • bench
  • streaming_modif
  • bug
  • multi_thread
  • refactoring_c_code
  • futhark_refac
  • one_dim_t_floats
  • reg
  • reg_order3
  • trying_base64
  • merging_j
  • trying_regularized
  • futharkalabos3d_troels_3d
  • futharkalabos3d_troels
  • futharkalabos3d_tuple
21 results

tensor_field.c

Blame
  • test_vectors.c 1.03 KiB
    /*
    	Autheur		: Abivarman KANDIAH
    	Date		: 22/02/2022
    	Fichier		: test_vectors.c
    	Descritpion : 
    */
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>
    #include "../header/vectors.h"
    
    int main()
    {	
    	//Test Vector create
    	vector test = vector_create();
    	printf("Created Vector lenght : %d \n", vector_length(test));
    
    	//Test Vector push
    	vector_push(test, 15);
    	printf("Modified Vector lenght : %d \n", vector_length(test));
    
    	//Test Vector pop
    	type val = vector_pop(test);
    	printf("Modified Vector lenght : %d and the value we popped : %d \n", vector_length(test), val);
    
    	//Test Vector set and get
    	vector_push(test, 42);
    	vector_set(test, 0, 69);
    	val = vector_get(test, 0);
    
    	printf("Modified Vector lenght : %d and the value we setted : %d \n", vector_length(test), val);
    	val = vector_pop(test);
    
    	//Test Vector remove
    	for (int i = 0; i < 6; i++)
    	{
    		vector_push(test, i);
    	}
    	printf("Value at index 3 : %d \n", vector_get(test, 3));
    	vector_remove(test, 3);
    	printf("New Value at index 3 : %d \n", vector_get(test, 3));
    
    
    
    	return 0;
    }