⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cvertex.java

📁 经典的货郎担问题解决办法
💻 JAVA
字号:
/*------------------------------------------------------------------class cVertex.This corresponds to the C struct cVertex -- type vertex.It is one cell of a vertex list, holding the point v,next and previous pointers, and Boolean flags (e.g., ear).Its only methods besides constuctors are printing methodsand ResetVertexTo3D (which raises a point onto a paraboloid).-------------------------------------------------------------------*/package com.well.www.user.xanthian.java.seeders;class cVertex {      cVertex prev, next;  cPointi v;  boolean ear = false;  int vnum;  cEdge duplicate;  boolean  onhull;              /* T iff point on hull. */  boolean  mark;  cVertex() {    prev = next = null;    v = new cPointi();    vnum = 0;    duplicate = null;    onhull = false;    mark = false;  }  cVertex(int i, int j) {           v = new cPointi();    v.x = i;    v.y = j;    v.z = i*i + j*j;    prev = next = null;  }  cVertex(int x, int y, int z) {    v = new cPointi();    v.x = x;    v.y = y;    v.z = z;    prev = next = null;  }  /* Raises point to 3D by placing in on paraboloid */  public void ResetVertex3D()  {    v.z = v.x*v.x + v.y*v.y;  }     public void PrintVertex(int index) {    System.out.print ( "V" + index + " = " );    v.PrintPoint();  }  public void PrintVertex() {    v.PrintPoint();  }  public void PrintVertex3D()  {    System.out.print("V"+vnum+" = ("+ v.x + ", " + v.y + ", " + v.z+"); ");  }  public void PrintVertex3D(int k)  {    System.out.print("V"+k+" = ("+ v.x + ", " + v.y + ", " + v.z + "); ");  }} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -