Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (62)
Showing
with 638 additions and 0 deletions
File added
load("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
perfArray
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point()
library(ggplot2)
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point()
GraphArray
perfTableau
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color="blue")) + geom_point()
GraphTableau
GraphTableau
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color="green")) + geom_point()
GraphTableau
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color='green')) + geom_point()
GraphTableau
GraphArray
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color='green')) + geom_point(color="green")
GraphTableau
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red")
GraphArray
perfLinked
GraphLinked = ggplot(perfLinked, aes(x=Taille, y=CPU, color="blue")) + geom_point(color="blue")
GraphLinked
GraphPerfInitializing <- rbind(GraphArray, GraphTableau, GraphLinked)
GraphPerfInitializing
GraphPerf <- ggplot(GraphPerfInitializing, aes(x=Taille, y=CPU)) + geom_point()
ggplot(GraphPerfInitializing, aes(x=Taille, y=CPU)) + geom_point()
GraphTableau
test<- rbind(perfArray, perfTableau, perfLinked)
GraphTest <- ggplot(test, aes(x=Taille, y=CPU)) + geom_point()
GraphTest
ggplot(perfArray, aes(x=Taille, y=CPU)) + geom_point() + geom_smooth(fill="blue", colour="darkblue", size=1)
warnings()
save.image("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
q()
load("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
perfArray
Array
graphArray
arrayGraph
GraphArray
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red") + geom_smooth()
library(ggplot2)
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red") + geom_smooth()
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red") + geom_smooth()
GraphArray
warnings()
q()
perf <- read.csv2("perf.csv", sep="\t", dec=".")
perfTableau <- read.csv2("perfTableau.csv", sep="\t", dec=".")
perfTableau <- read.csv2("perfTableau.csv", sep="\t", dec=".")
perfArray <- read.csv2("perfArray.csv", sep="\t", dec=".")
perfLinked <- read.csv2("perfLinked.csv", sep="\t", dec=".")
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color=blue")
)
"
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color="blue")
library(ggplot2)
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color="blue")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,colour="Performance Add Tableau")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,colour=Performance Add Tableau)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color="Performance Add Tableau")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color="red")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color=red)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color=time)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color=CPU)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphArray <- ggplot(perfArray, aes(x=Taille,y=CPU,color=CPU)) + geom_smooth(color="red") + ggtitle("Evaluation du temps d'xcution de Add sur une Array")
graphArray
graphLinked <- ggplot(perfLinked, aes(x=Taille,y=CPU,color=CPU)) + geom_smooth(color="green") + ggtitle("Evaluation du temps d'xcution de Add sur une LinkedList")
graphLinked
graph <- ggarrange(graphTableau, graphArray, graphLinked, Labels=c("Tableau","Array","Linked"), ncol=2, nrow=2)
library(ggpubr)
install.package(ggpubr)
instal.package(ggpubr)
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
instal.packages(ggpubr)
install.packages(ggpubr)
if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/ggpubr")
devtools::install_github("kassambara/ggpubr")
install.packages(ggpubr)
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
library(devtools)
library("devtools")
library("devtools")
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
print(perfArray)
print(graphArray)
print(graphLinked)
using pushViewport()
pushViewport(viewport(layout = grid.layout(2,2)))
if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/ggpubr")
devtools::install_github("kassambara/ggpubr")
install.packages("ggpubr")
libraryr(ggpubr)
library(ggpubr)
graph <- ggarrange(graphTableau, graphArray, graphLinked, Labels=c("Tableau","Array","Linked"), ncol=2, nrow=2)
graph
save.image("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
perf <- read.csv2("perf.csv", sep="\t", dec=".")
perf
perf <- read.csv2("perf.csv", sep="\t", dec=".")
perf
ggplot(perf,aes(y = CPU, x = Taille, colour = Structure, shape =Structure))
ggplot(perf,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth()
ggplot(perf,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance CPU de la mthode ADD en fonction de la taille")
perfAdd <- read.csv2("perf.csv", sep="\t", dec=".")
GraphAdd <- ggplot(perfAdd,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance CPU de la mthode ADD en fonction de la taille")
GraphAdd
GraphAddCPU <- ggplot(perfAdd,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance CPU de la mthode ADD en fonction de la taille")
GraphAddMemoire <- ggplot(perfAdd,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance mmoire de la mthode ADD en fonction de la taille")
GraphAddMemoire
GraphAddMemoire <- ggplot(perfAdd,aes(y = Memoire, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance mmoire de la mthode ADD en fonction de la taille")
GraphAddMemoire
GraphAddMemoire <- ggplot(perfAdd,aes(y = Mem, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance mmoire de la mthode ADD en fonction de la taille")
GraphAddMemoire
save.image("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
q()
File added
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="Common"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-15">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>P4a</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=15
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=15
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=15
package PersonalStructure;
import defaultpackage.Structure;
public class ChainedList implements Structure {
protected Link head;
protected Cursor cursor;
protected int nbVal;
public ChainedList(Link head, Cursor cursor) {
this.head = head;
this.cursor = cursor;
this.nbVal = 1;
}
public ChainedList(Cursor cursor) {
this.cursor = cursor;
this.cursor.setList(this);
this.nbVal = 0;
}
public void setNextLink(Link currentLink)
{
Link last_next = this.cursor.currentLink.next;
this.cursor.currentLink.next = currentLink;
nbVal+=1;
}
public void setPreviousLink(Link currentLink)
{
Link last_next = this.cursor.currentLink.next;
this.cursor.currentLink.next = currentLink;
nbVal+=1;
}
public Link getLink()
{
return this.cursor.currentLink;
}
public Cursor getCursor()
{
return this.cursor;
}
public Link getNextLink()
{
return this.cursor.currentLink.next;
}
public Link getPreviousLink()
{
return this.cursor.currentLink.next;
}
public void replaceCursor(int position)
{
this.cursor.position(position);
}
public boolean isEmpty() {
boolean res = false;
if(this.nbVal != 0)
res = true;
return res;
}
@Override
public void Add(int value) {
if (nbVal == 0) {
Link new_link = new Link(value);
this.head = new_link;
this.head.last = new_link;
this.cursor.currentLink = new_link;
this.head.next = new_link;
}
else {
System.out.println("val = " + value);
this.replaceCursor(this.nbVal);
Link last_before_added = this.cursor.currentLink.last;
Link next_after_added = this.head;
Link new_link = new Link(value, next_after_added, last_before_added);
last_before_added.next = new_link;
this.head.last = new_link;
this.cursor.currentLink = new_link;
}
this.nbVal += 1;
System.out.println("nbVal = " + this.nbVal);
}
@Override
public void Remove(int index) throws Exception {
if ((index < 0) && isEmpty())
throw new IndexOutOfBoundsException("Wrong position");
this.replaceCursor(index);
Link last_of_remove = this.cursor.currentLink.last;
Link next_of_remove = this.cursor.currentLink.next;
last_of_remove.next = next_of_remove;
next_of_remove.last = last_of_remove;
this.cursor.currentLink = next_of_remove;
}
@Override
public int Select(int index) throws Exception {
if ((index < 0) && isEmpty())
throw new IndexOutOfBoundsException("Wrong position");
this.replaceCursor(index);
return this.cursor.currentLink.value;
}
}
package PersonalStructure;
public class Cursor {
protected Link currentLink;
protected ChainedList currentList;
protected int pos;
public Cursor(ChainedList currentList, Link currentLink, int pos) {
this.currentLink = currentLink;
this.currentList = currentList;
this.pos = pos;
}
public Cursor() {
this.pos = 0;
}
public void position(int pos)
{
// si on est arrivé à la bonne position, on garde le maillon actuel
if (pos == this.pos)
{ }
// si nous sommes avant la position voulue, on avance
else if (pos > this.pos)
{
while(pos != this.pos)
{
goForward();
}
}
// si nous sommes après la position voulue, on recule
else if (pos < this.pos)
{
while(pos != this.pos)
{
goBack();
}
}
}
private void goForward() {
// si on n'est pas encore arrivé à la fin de la liste, on avance
if(this.pos <= this.currentList.nbVal)
{
this.pos += 1;
this.currentLink = this.currentLink.next;
}
// sinon on retourne au début de la liste
else {
this.pos = 0;
this.currentLink = this.currentList.head;
}
}
private void goBack() {
// si on n'est pas encore arrivé au début de la liste, on recule
if(this.pos >= 0)
{
this.pos -= 1;
}
// sinon on va à la fin de la liste
else {
this.pos = this.currentList.nbVal;
}
// on recule toujours
this.currentLink = this.currentLink.last;
}
public void setList(ChainedList list) {
this.currentList = list;
this.currentLink = list.head;
}
}
package PersonalStructure;
public class Link {
protected int value;
protected Link next;
protected Link last;
public Link(int value, Link next, Link last) {
this.value = value;
this.next = next;
this.last = next;
}
public Link(int value) {
this.value = value;
}
public void setNext(Link next) {
this.next = next;
}
public void setLast(Link last) {
this.last = last;
}
}
package StandardStructure;
import defaultpackage.Structure;
import java.util.ArrayList;
import java.util.Random;;
public class ArrayListC implements Structure
{
protected ArrayList<Integer> arrayList;
public ArrayListC(int nbValue)
{
Random rnd = new Random();
arrayList = new ArrayList<Integer>();
for(int i = 0; i < nbValue; i++)
{
Add(rnd.nextInt());
}
}
@Override
public void Add(int value)
{
arrayList.add(value);
}
@Override
public void Remove(int index) throws Exception
{
try
{
arrayList.remove(index);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public int Select(int index) throws Exception
{
try
{
return arrayList.get(index);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
}
package StandardStructure;
import java.util.LinkedList;
import java.util.Random;
import defaultpackage.Structure;
public class LinkedListC implements Structure
{
private LinkedList<Integer> linkedList;
public LinkedListC(int nbValue)
{
Random rnd = new Random();
linkedList = new LinkedList<Integer>();
for(int i = 0; i < nbValue; i++) {
Add(rnd.nextInt());
}
}
@Override
public void Add(int value) {
// TODO Auto-generated method stub
linkedList.add(value);
}
@Override
public void Remove(int index) throws Exception {
// TODO Auto-generated method stub
try
{
linkedList.remove(index);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public int Select(int index) throws Exception
{
// TODO Auto-generated method stub
try
{
return linkedList.get(index);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
}
package StandardStructure;
import java.util.Random;
import defaultpackage.Structure;
public class Table implements Structure
{
protected Integer[] tab;
public Table(int nbValue)
{
System.out.println("ajout d'une valeur");
Random rnd = new Random();
tab = new Integer[nbValue];
for(int i = 0; i < nbValue ; i++)
{
tab[i] = rnd.nextInt();
}
}
@Override
public void Add(int value) {
// TODO Auto-generated method stub
Integer[] temp = new Integer[tab.length + 1];
for(int i = 0; i < tab.length; i++) {
temp[i] = tab[i];
}
temp[temp.length] = value;
tab = temp;
}
@Override
public void Remove(int index) throws Exception
{
// TODO Auto-generated method stub
try
{
tab[index] = null;
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public int Select(int index) throws Exception
{
// TODO Auto-generated method stub
try
{
return tab[index];
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
}
package defaultpackage;
import java.math.BigInteger;
import java.util.Random;
import PersonalStructure.ChainedList;
import PersonalStructure.Cursor;
import StandardStructure.ArrayListC;
import StandardStructure.LinkedListC;
import StandardStructure.Table;
public class Main {
public static void main(String[] args) {
System.out.println("Je suis ici");
// TODO Auto-generated method stub
GenerateTab(args[0], Integer.parseInt(args[1]));
//GenerateTab("Maillon", 1000000);
}
public static void GenerateTab(String type, int nbValue)
{
System.out.println("Je rentre : " + type);
if(type.equals("Tableau"))
{
Table tab = new Table(nbValue);
System.out.println("appeler");
}
if(type.equals("Array")) {
ArrayListC array = new ArrayListC(nbValue);
}
if(type.equals("Linked")) {
LinkedListC linked = new LinkedListC(nbValue);
}
if(type.equals("Maillon")) {
Cursor cursor = new Cursor();
ChainedList maillons = new ChainedList(cursor);
Random rnd = new Random();
for(int i = 0; i < nbValue; i++) {
maillons.Add(rnd.nextInt());
}
}
}
}
package defaultpackage;
public interface Structure
{
public void Add(int value);
public void Remove(int index) throws Exception;
public int Select(int index) throws Exception;
}
File added
File added
File added
File added
File added
File added