L
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,28 +0,0 @@
|
||||
CC = gcc
|
||||
|
||||
CFLAGS = -Wall -Wextra -I../ -g
|
||||
TARGET = matrix
|
||||
|
||||
SRC_DIR = ../code
|
||||
OBJ_DIR = ../.o
|
||||
|
||||
SRCS = $(wildcard $(SRC_DIR)/*.c)
|
||||
OBJS = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRCS))
|
||||
|
||||
.PHONY: all clean run
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) $(CFLAGS) $(OBJS) -o $(TARGET)
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
|
||||
@mkdir -p $(OBJ_DIR)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
run: $(TARGET)
|
||||
./$(TARGET) < input > output
|
||||
@cat output
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ_DIR) $(TARGET) output
|
||||
@@ -0,0 +1,44 @@
|
||||
[
|
||||
{
|
||||
"file": "src/io.c",
|
||||
"arguments": [
|
||||
"gcc",
|
||||
"-I./include",
|
||||
"-g",
|
||||
"-c",
|
||||
"src/io.c",
|
||||
"-o",
|
||||
".obj/io.o"
|
||||
],
|
||||
"directory": "/home/oniic/Documents/sibsutisiv522s18/1Y-2H/prog",
|
||||
"output": ".obj/io.o"
|
||||
},
|
||||
{
|
||||
"file": "src/main.c",
|
||||
"arguments": [
|
||||
"gcc",
|
||||
"-I./include",
|
||||
"-g",
|
||||
"-c",
|
||||
"src/main.c",
|
||||
"-o",
|
||||
".obj/main.o"
|
||||
],
|
||||
"directory": "/home/oniic/Documents/sibsutisiv522s18/1Y-2H/prog",
|
||||
"output": ".obj/main.o"
|
||||
},
|
||||
{
|
||||
"file": "src/matrix.c",
|
||||
"arguments": [
|
||||
"gcc",
|
||||
"-I./include",
|
||||
"-g",
|
||||
"-c",
|
||||
"src/matrix.c",
|
||||
"-o",
|
||||
".obj/matrix.o"
|
||||
],
|
||||
"directory": "/home/oniic/Documents/sibsutisiv522s18/1Y-2H/prog",
|
||||
"output": ".obj/matrix.o"
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
#ifndef Head
|
||||
#define Head
|
||||
|
||||
// INCLUDE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
// DEFINE
|
||||
#define BUFF_MAX 10 //(char) <= 254
|
||||
#define IN_BUFF_CHARS 10 //(char) <= 254
|
||||
|
||||
//TypeDef
|
||||
|
||||
// FUNC
|
||||
// === io.c ===
|
||||
MATRIX2D* create_matrix2d(int rows, int cols);
|
||||
char buff_input(char *inbuff, char *_buff);
|
||||
char cmd_buff(char* _buff,char** _charCommands,char NUM_OF_CHAR_COMMANDS);
|
||||
char get_matrix_num(void);
|
||||
int get_num(void);
|
||||
|
||||
#endif
|
||||
@@ -1,35 +1,14 @@
|
||||
#ifndef Head
|
||||
#define Head
|
||||
|
||||
// INCLUDE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
// DEFINE
|
||||
#define LLI long long int
|
||||
#define MAX_MATRIX_ALIVE 21
|
||||
#define BUFF_MAX 10 //(char) <= 254
|
||||
#define IN_BUFF_CHARS 10 //(char) <= 254
|
||||
|
||||
//TypeDef
|
||||
// matrix.c
|
||||
typedef struct {
|
||||
int rows;
|
||||
int cols;
|
||||
int** data;
|
||||
} MATRIX2D;
|
||||
|
||||
|
||||
// FUNC
|
||||
// === io.c ===
|
||||
MATRIX2D* create_matrix2d(int rows, int cols);
|
||||
char buff_input(char *inbuff, char *_buff);
|
||||
char cmd_buff(char* _buff,char** _charCommands,char NUM_OF_CHAR_COMMANDS);
|
||||
char get_matrix_num(void);
|
||||
int get_num(void);
|
||||
|
||||
// === matrix.c ===
|
||||
void create_matrix(MATRIX2D** addr, unsigned char n, int rows, int cols);
|
||||
void input_matrix(MATRIX2D** addr, unsigned char n);
|
||||
void get_matrix(MATRIX2D** addr, unsigned char n);
|
||||
@@ -41,8 +20,9 @@
|
||||
void get_matrix_col(MATRIX2D** addr, unsigned char n, int c);
|
||||
void get_matrix_row(MATRIX2D** addr, unsigned char n, int r);
|
||||
void transp_matrix(MATRIX2D** addr, unsigned char n);
|
||||
LLI determ_matrix(MATRIX2D** addr, unsigned char n);
|
||||
long long int determ_matrix(MATRIX2D** addr, unsigned char n);
|
||||
void obr_matrix(MATRIX2D** addr, unsigned char n);
|
||||
void is_Matrix_Exist(MATRIX2D** addr, unsigned char n);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
CC = gcc
|
||||
|
||||
CFLAGS = -I./include -g
|
||||
LDFLAGS = -lncursesw -lpanel -lmenu
|
||||
|
||||
TARGET = matrix
|
||||
|
||||
SRC_DIR = src
|
||||
OBJ_DIR = .obj
|
||||
|
||||
SRC = $(wildcard $(SRC_DIR)/*.c)
|
||||
OBJ = $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRC))
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJ)
|
||||
$(CC) $(OBJ) -o $(TARGET) $(LDFLAGS)
|
||||
|
||||
# Компиляция .c -> .o в .obj/
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
# Создание папки для объектов
|
||||
$(OBJ_DIR):
|
||||
mkdir -p $(OBJ_DIR)
|
||||
|
||||
run:
|
||||
./matrix < input > output
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ_DIR) $(TARGET) output
|
||||
|
||||
.cc: $(OBJ)
|
||||
mkdir -p $(OBJ_DIR)
|
||||
@for src in $(SRC); do \
|
||||
obj=$(OBJ_DIR)/$$(basename $$src .c).o; \
|
||||
bear -- $(CC) $(CFLAGS) -c $$src -o $$obj; \
|
||||
done
|
||||
mv ./compile_commands.json .build/ || true
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user