My first blog 1.0(beta)

本文详细介绍了如何使用Java编写第一个程序HelloWorld,包括下载并安装JDK、配置环境变量、编写及保存代码,以及运行Java程序的具体步骤。

Use JAVA to write a HelloWorld

Step 1:Download a JDK

website:http://www.oracle.com/technetwork/java/javase/downloads/index.html
and install it to your system(the detailed process is solved by yourself)

Step 2:Configure the environment

Reference the website:
https://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html

Step 3

Create a HelloWorld.txt profile. Then input the following code in it

public class HelloWorld {
    public static void main(String[] args){
        System.out.println("Hello world!");
        }
}

save it.
And change its suffix name,such as Helloworld.java.

Step 4:Input commands to run the Helloworld.java

Press windows+R,and input “cmd”.
Then input the following commands in sequence:
“src” enter
“javac Helloworld.java” enter
“java HelloWorld” enter
and then you will see Hello World!

program main implicit none type mrchead integer nx ! /* # of columns ( fastest changing in the map */ integer ny ! /* # of rows */ integer nz ! /* # of sections (slowest changing in the map */ integer mode ! /* data type ! 0 = image data in bytes ! 1 = image data in short integer ! 2 = image data in floats ! 3 = complex data in complex short integers ! 4 = complex data in complex reals */ integer nxstart !/* number of first column in map (default = 0) */ integer nystaproc3d !/* number of first row in map (default = 0) */ integer nzstart !/* number of first ssection in map (default = 0) */ integer mx !/* number of intervals along X */ integer my !/* number of intervals along Y */ integer mz !/* number of intervals along Z */ real a !/* cell dimensions in X (angstrom) proc3d rec-ort-8.5-12.mrc core.mrc apix=2.152 mask=122 */ real b !/* cell dimensions in Y (angstrom) */ real c !/* cell dimensions in Z (angstrom) */ real alpha !/* cell angles between Y and Z */ real beta !/* cell angles between X and Z */ real gamma !/* cell angles between X and Y */ integer mapc !/* number of axis corresponding to columns (X) */ integer mapr !/* number of axis corresponding to rows (Y) */ integer maps !/* number of axis corresponding to sections (Z) */ real amin ! /* minimum density value */ real amax !/* maximum density value */ real amean ! /* mean density value */ integer ispg !/* space group number (0 for images) */ integer nsymbt ! /* # of bytes for symmetry operators */ integer extra(25) !/* user defined storage space */ real xorigin !/* X phase origin */ real yorigin !/* Y phase origin */ real zorigin !/* z phase origin */ character map(4) character machinestamp(4) real arms integer nlabl !/* # of labels being used in the MRC header */ character label(10,80) !/* actual text labels end type type(mrchead):: mrc integer hx,ky,lz,iargc,n,i real r,phi,r0,r10,x,y,r1,AVG,point,FFTsize real,allocatable:: density3d(:,:,:) character(len=54) :: par(2) ! n=iargc() ! if (n.lt.1) then ! call help ! goto 999 ! end if ! do i=1,n ! call getarg(i,par(i)) ! end do ! open(10,file='C:\Users\Administrator\Desktop\test\J723-core-1.mrc',form='unformatted',access='stream',status='old') open(11,file='C:\Users\Administrator\Desktop\test\J727.mrc',form='unformatted',access='stream') read(10) mrc FFTsize=mrc%nx allocate(density3d(-FFTsize/2:FFTsize/2-1,-FFTsize/2:FFTsize/2-1,-FFTsize/2:FFTsize/2-1)) read(10) density3d close(10) ! r0=140 ! r10=75 ! ! AVG=0.0 ! point=0.0 ! do lz=-216,215 ! do ky=-216,215 ! !y=ky ! do hx=-216,215 ! !x=hx ! r=sqrt(float(hx**2+ky**2+lz**2)) ! r1=sqrt(float(ky**2+hx**2)) ! if ((r.le.r0).or.(r1.ge.r10)) cycle ! if(R.gt.185) cycle ! AVg=AVG+ density3d(hx,ky,lz) ! point=point+1.0 ! ! end do ! end do ! end do ! ! AVG=AVG/point do lz=-FFTsize/2,FFTsize/2-1 do ky=-FFTsize/2,FFTsize/2-1 do hx=-FFTsize/2,FFTsize/2-1 ! ! r=sqrt(float(hx**2+ky**2+lz**2)) ! if(r.le.49)then ! density3d(hx,ky,lz)=1.0 ! endif ! r1=sqrt(float(ky**2+hx**2)) ! if ((r.le.r0).and.(r.ge.r10))then !.and.(lz.le.r0) ! phi=atan2(y,x)*180.0/3.1415926 ! if((phi.ge.25.0).and.(phi.le.125.0)) then !! !! density3d(lz,ky,hx)=.0 !!! else if(R.gt.185 .or. r1.gt. 185) then ! density3d(lz,ky,hx)=0.0 ! end if ! end if ! ! write(11) mrc ! write(11) density3d ! close(11) ! end if(density3d(hx,ky,lz).eq. 0.000)then density3d(hx,ky,lz)=0.000 else density3d(hx,ky,lz)=1.0 endif end do end do end do print*,'write 3d map' write(11) mrc write(11) density3d close(11) deallocate(density3d) return 999 end subroutine help implicit none print*,'please input model3d maskmodel' end ! open(10,file='D:\T7TUTEN\class2\rec-mrcs-core2-pt2-5.mrc',form='unformatted',access='stream',status='old') ! open(11,file='D:\T7TUTEN\class2\core-model.mrc',form='unformatted',access='stream') ! read(10) mrc ! FFTsize=mrc%nx ! allocate(density3d(-FFTsize/2:FFTsize/2-1,-FFTsize/2:FFTsize/2-1,-FFTsize/2:FFTsize/2-1)) ! read(10) density3d ! close(10) ! ! do lz=-FFTsize/2,FFTsize/2-1 ! ! do ky=-FFTsize/2,FFTsize/2-1 ! ! do hx=-FFTsize/2,FFTsize/2-1 ! ! r=sqrt(float(hx**2+ky**2)) ! if(r.gt. 80.0)then ! density3d(hx,ky,lz)=0.0 ! endif ! ! end do ! end do ! end do ! print*,'write 3d map' ! write(11) mrc ! write(11) density3d ! close(11) ! deallocate(density3d) !999 end ! !subroutine help ! implicit none ! print*,'please input model3d maskmodel' !end
08-26
内容概要:本文系统介绍了算术优化算法(AOA)的基本原理、核心思想及Python实现方法,并通过图像分割的实际案例展示了其应用价值。AOA是一种基于种群的元启发式算法,其核心思想来源于四则运算,利用乘除运算进行全局勘探,加减运算进行局部开发,通过数学优化器加速函数(MOA)和数学优化概率(MOP)动态控制搜索过程,在全局探索与局部开发之间实现平衡。文章详细解析了算法的初始化、勘探与开发阶段的更新策略,并提供了完整的Python代码实现,结合Rastrigin函数进行测试验证。进一步地,以Flask框架搭建前后端分离系统,将AOA应用于图像分割任务,展示了其在实际工程中的可行性与高效性。最后,通过收敛速度、寻优精度等指标评估算法性能,并提出自适应参数调整、模型优化和并行计算等改进策略。; 适合人群:具备一定Python编程基础和优化算法基础知识的高校学生、科研人员及工程技术人员,尤其适合从事人工智能、图像处理、智能优化等领域的从业者;; 使用场景及目标:①理解元启发式算法的设计思想与实现机制;②掌握AOA在函数优化、图像分割等实际问题中的建模与求解方法;③学习如何将优化算法集成到Web系统中实现工程化应用;④为算法性能评估与改进提供实践参考; 阅读建议:建议读者结合代码逐行调试,深入理解算法流程中MOA与MOP的作用机制,尝试在不同测试函数上运行算法以观察性能差异,并可进一步扩展图像分割模块,引入更复杂的预处理或后处理技术以提升分割效果。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值