Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Captura de pantalla de 2020-09-10 10-45-35.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions FIBO_TIME.dat
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
<<<<<<< HEAD
0.000000 0.000000 0.000010
1.000000 0.000000 0.000000
2.000000 0.000000 0.000000
3.000000 0.000000 0.000010
4.000000 0.000000 0.000020
5.000000 0.000000 0.000020
6.000000 0.000000 0.000020
7.000000 0.000000 0.000030
8.000000 0.000000 0.000020
9.000000 0.000000 0.000020
10.000000 0.000000 0.000030
11.000000 0.000001 0.000040
12.000000 0.000001 0.000050
13.000000 0.000002 0.000040
14.000000 0.000003 0.000040
15.000000 0.000005 0.000040
16.000000 0.000008 0.000060
17.000000 0.000013 0.000050
18.000000 0.000020 0.000050
19.000000 0.000032 0.000050
20.000000 0.000052 0.000060
21.000000 0.000082 0.000060
22.000000 0.000130 0.000060
23.000000 0.000211 0.000050
24.000000 0.000341 0.000060
25.000000 0.000569 0.000060
||||||| f46ea0f
=======
0.000000 0.000000 0.000000
1.000000 0.000000 0.000000
2.000000 0.000000 0.000000
Expand Down Expand Up @@ -29,3 +58,4 @@
28.000000 0.006250 0.000000
29.000000 0.009687 0.000000
30.000000 0.015938 0.000000
>>>>>>> e94102e9b652f269c770d77c8267559b161b52fd
50 changes: 50 additions & 0 deletions Sequences.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
<<<<<<< HEAD
//
// Sequences.c
//
//
// Created by Cesar Angeles on 07/09/2020.
//

#include <stdio.h>
#include <stdlib.h>

#define Sequences_IMPORT
#include "Sequences.h"



long long int Sequences_sfibo(long long int n){
long long int sequence_1 = 0, sequence_2 = 1, temp = 0;
int index = 0;

for (index = 0; index < n; index ++){

temp = sequence_2;
sequence_2 = sequence_2 + sequence_1;
sequence_1 = temp;

}
(n<=0) ? sequence_2 = 0 : (sequence_2 = sequence_1);

return sequence_2;

}



long long int Sequences_rfibo(long long int n){

if (n == 1){
return 1;
}
if(n > 1){
return Sequences_rfibo(n - 1) + Sequences_rfibo(n - 2);
}else{
return 0;
}

}
||||||| f46ea0f
=======
//
// Sequences.h
//
Expand Down Expand Up @@ -85,3 +134,4 @@ long long int Sequences_rfibo(long long int number){
#undef Sequences_IMPORT
#undef EXTERN
#endif /* Sequences_h */
>>>>>>> e94102e9b652f269c770d77c8267559b161b52fd
73 changes: 73 additions & 0 deletions archivos.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
//
// archivos.c
//
// Created by Sergio Medina Galàn and Gustavo Luna Maya on 12/09/2020
//
//


/*Include standard headers*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

/*Include modules header we directly invoke here: */
#include"archivos.h"

/**
* Initialises a new file pointer identified via its name and mode.
* @param
* name (char *):
* Name of the file
* mode (char *):
* Mode of file to be opened {r, rb, a, ab, w, wb}
*
* @return FILE * opened_file.
*/
extern FILE * file_new( char * name, char *mode)
{
FILE *fp;
fp = fopen(name,mode);
return fp;
}


/**
* Writes a bidimensional buffer array into a file.
* @param
* file (FILE *):
* Storage file
* columns (size_t ):
* length of the buffer array
* buff [ ][columns] (long double):
* RAM matrix
* rows (size_t):
* width of the storage buffer
*
* @return void.
*/
extern void file_num_write(FILE * file, size_t columns, long double buff[] [columns], size_t rows)
{
char linea[10];
sprintf(linea,"%zu %zu \n",rows,columns);
// fputs (linea, file);
for (size_t i =0; i<rows; i++){
linea[0] = '\0';


char buffer[8];
for(int j =0; j<=2; j++){
fprintf(file,"%1.5Lf \t",buff[i][j]);

strcat(linea,buffer);
}
fprintf(file,"\n");
int len = strlen(linea);
linea[len-1] = '\n';
fputs(linea,file);

}
}


73 changes: 73 additions & 0 deletions archivos.c~
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
//
// files.c
//
// Created by Sergio Medina Galàn and Gustavo Luna Maya on 12/09/2020
//
//


/*Include standard headers*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

/*Include modules header we directly invoke here: */
#include"files.h"

/**
* Initialises a new file pointer identified via its name and mode.
* @param
* name (char *):
* Name of the file
* mode (char *):
* Mode of file to be opened {r, rb, a, ab, w, wb}
*
* @return FILE * opened_file.
*/
extern FILE * file_new( char * name, char *mode)
{
FILE *fp;
fp = fopen(name,mode);
return fp;
}


/**
* Writes a bidimensional buffer array into a file.
* @param
* file (FILE *):
* Storage file
* columns (size_t ):
* length of the buffer array
* buff [ ][columns] (long double):
* RAM matrix
* rows (size_t):
* width of the storage buffer
*
* @return void.
*/
extern void file_num_write(FILE * file, size_t columns, long double buff[] [columns], size_t rows)
{
char linea[10];
sprintf(linea,"%zu %zu \n",rows,columns);
// fputs (linea, file);
for (size_t i =0; i<rows; i++){
linea[0] = '\0';


char buffer[8];
for(int j =0; j<=2; j++){
fprintf(file,"%1.5Lf \t",buff[i][j]);

strcat(linea,buffer);
}
fprintf(file,"\n");
int len = strlen(linea);
linea[len-1] = '\n';
fputs(linea,file);

}
}


58 changes: 58 additions & 0 deletions archivos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// archivos.h
//
//
// Created by Cesar Angeles on 07/09/2020.
//

#ifndef files_h
#define files_h

#include <stdio.h>

#ifdef files_IMPORT
#define EXTERN
#else
#define EXTERN extern
#endif


/* files.h -- Function prototypes */

/**
* Instanciates a new file pointer identified via its name and mode.
* @param
* name (char *):
* Name of the file
* mode (char *):
* Mode of file to be opened {r, rb, a, ab, w, wb}
*
* @return FILE * opened_file.
*/
EXTERN FILE * file_new(char *name, char *mode);



/**
* Writes a bidimensional buffer array into a file.
* @param
* file (FILE *):
* Storage file
* columns (size_t ):
* length of the buffer array
* buff [ ][columns] (long double):
* RAM matrix
* rows (size_t):
* width of the storage buffer
*
* @return void.
*/

EXTERN void file_num_write(FILE * file, size_t columns, long double buff[] [columns], size_t rows);

#undef files_IMPORT
#undef EXTERN



#endif /* files_h */
58 changes: 58 additions & 0 deletions archivos.h~
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// files.h
//
//
// Created by Cesar Angeles on 07/09/2020.
//

#ifndef files_h
#define files_h

#include <stdio.h>

#ifdef files_IMPORT
#define EXTERN
#else
#define EXTERN extern
#endif


/* files.h -- Function prototypes */

/**
* Instanciates a new file pointer identified via its name and mode.
* @param
* name (char *):
* Name of the file
* mode (char *):
* Mode of file to be opened {r, rb, a, ab, w, wb}
*
* @return FILE * opened_file.
*/
EXTERN FILE * file_new(char *name, char *mode);



/**
* Writes a bidimensional buffer array into a file.
* @param
* file (FILE *):
* Storage file
* columns (size_t ):
* length of the buffer array
* buff [ ][columns] (long double):
* RAM matrix
* rows (size_t):
* width of the storage buffer
*
* @return void.
*/

EXTERN void file_num_write(FILE * file, size_t columns, long double buff[] [columns], size_t rows);

#undef files_IMPORT
#undef EXTERN



#endif /* files_h */
Loading