<commit_before># =============================================================================
# nlp-unconstrained-core/hooke-jeeves/perl/Makefile
# =============================================================================
# Nonlinear Optimization Algorithms Multilang. Version 0.1
# =============================================================================
# Nonlinear programming algorithms as the (un-)constrained minimization
# problems with the focus on their numerical expression using various
# programming languages.
#
# This is the Hooke and Jeeves nonlinear unconstrained minimization algorithm.
# =============================================================================

BIN_DIR      = bin
LIB_DIR      = lib
SRC_DIR      = src
BASE_PACKAGE = NLPUCCoreHooke
BASE_CLASS   = $(BASE_PACKAGE).pm
CLASSES      = $(SRC_DIR)/$(BASE_CLASS) $(SRC_DIR)/$(BASE_PACKAGE)
SCRIPT1      = hooke
SCRIPT2S     = -woods
SCRIPT2      = $(SCRIPT1)$(SCRIPT2S)

# Specify flags and other vars here.
MKDIR      = mkdir
ECHO       = echo
ECHOFLAGS  = -e
SED        = sed
SEDFLAGS   = -i -e
SEDREGEX   = "s/^\ //g"
CHMOD      = chmod
CHMODFLAGS = -v
CHMODMODE  = 755
CP         = cp
CPFLAGS    = -vR
RMFLAGS    = -vR

# Startup scripts for Rosenbrock and Woods test problems like here documents.
# Rosenbrock:
define SCRIPT1_FULL
#!/usr/bin/env perl\n\
# =============================================================================\n\
# nlp-unconstrained-core/hooke-jeeves/perl/$(BIN_DIR)/$(SCRIPT1)\n\
# =============================================================================\n\
# Nonlinear Optimization Algorithms Multilang. Version 0.1\n\
# =============================================================================\n\
\n\
use strict;\n\
use warnings;\n\
use v5.10;\n\
\n\
use lib \"$(LIB_DIR)\";\n\
\n\
use $(BASE_PACKAGE);\n\
\n\
# Solving the Rosenbrock test problem.\n\
$(BASE_PACKAGE)->rosenbrock();\n\
\n\
# =============================================================================\n\
# vim:set nu:et:ts=4:sw=4:\n\
# =============================================================================
endef

# Woods:
define SCRIPT2_FULL
#!/usr/bin/env perl\n\
# =============================================================================\n\
# nlp-unconstrained-core/hooke-jeeves/perl/$(BIN_DIR)/$(SCRIPT2)\n\
# =============================================================================\n\
# Nonlinear Optimization Algorithms Multilang. Version 0.1\n\
# =============================================================================\n\
\n\
use strict;\n\
use warnings;\n\
use v5.10;\n\
\n\
use lib \"$(LIB_DIR)\";\n\
\n\
use $(BASE_PACKAGE);\n\
\n\
# Solving the Woods test problem.\n\
$(BASE_PACKAGE)->woods();\n\
\n\
# =============================================================================\n\
# vim:set nu:et:ts=4:sw=4:\n\
# =============================================================================
endef

# Making the target.
$(BIN_DIR) $(LIB_DIR):
	if [ ! -d "$(BIN_DIR)" ]; then \
		$(MKDIR) $(BIN_DIR); \
		if [ ! -d "$(LIB_DIR)" ]; then \
			$(MKDIR) $(LIB_DIR); \
		fi; \
		$(ECHO) $(ECHOFLAGS) "$(SCRIPT1_FULL)" > $(BIN_DIR)/$(SCRIPT1); \
		$(ECHO) $(ECHOFLAGS) "$(SCRIPT2_FULL)" > $(BIN_DIR)/$(SCRIPT2); \
		$(SED) $(SEDFLAGS) $(SEDREGEX) $(BIN_DIR)/*; \
		$(CHMOD) $(CHMODFLAGS) $(CHMODMODE) $(BIN_DIR)/*; \
		$(CP) $(CPFLAGS) $(CLASSES) $(LIB_DIR); \
	fi

.PHONY: all clean

all: $(BIN_DIR) $(LIB_DIR)

clean:
	$(RM) $(RMFLAGS) $(BIN_DIR) $(LIB_DIR)

# =============================================================================
# vim:set nu:et:ts=4:sw=4:
# =============================================================================
<commit_msg>NLPUC: Hooke-Jeeves-perl: Check for compilation errors.<commit_after># =============================================================================
# nlp-unconstrained-core/hooke-jeeves/perl/Makefile
# =============================================================================
# Nonlinear Optimization Algorithms Multilang. Version 0.1
# =============================================================================
# Nonlinear programming algorithms as the (un-)constrained minimization
# problems with the focus on their numerical expression using various
# programming languages.
#
# This is the Hooke and Jeeves nonlinear unconstrained minimization algorithm.
# =============================================================================

BIN_DIR      = bin
LIB_DIR      = lib
SRC_DIR      = src
BASE_PACKAGE = NLPUCCoreHooke
BASE_CLASS   = $(BASE_PACKAGE).pm
CLASSES      = $(SRC_DIR)/$(BASE_CLASS) $(SRC_DIR)/$(BASE_PACKAGE)
SCRIPT1      = hooke
SCRIPT2S     = -woods
SCRIPT2      = $(SCRIPT1)$(SCRIPT2S)

# Specify flags and other vars here.
PERL      = perl
PERLFLAGS = -c

CD           = cd
GREP         = grep
EXIT         = exit
EXIT_FAILURE = 1
EXIT_SUCCESS = 0
MKDIR        = mkdir
ECHO         = echo
ECHOFLAGS    = -e
SED          = sed
SEDFLAGS     = -i -e
SEDREGEX     = "s/^\ //g"
CHMOD        = chmod
CHMODFLAGS   = -v
CHMODMODE    = 755
CP           = cp
CPFLAGS      = -vR
RMFLAGS      = -vR

# Startup scripts for Rosenbrock and Woods test problems like here documents.
# Rosenbrock:
define SCRIPT1_FULL
#!/usr/bin/env perl\n\
# =============================================================================\n\
# nlp-unconstrained-core/hooke-jeeves/perl/$(BIN_DIR)/$(SCRIPT1)\n\
# =============================================================================\n\
# Nonlinear Optimization Algorithms Multilang. Version 0.1\n\
# =============================================================================\n\
\n\
use strict;\n\
use warnings;\n\
use v5.10;\n\
\n\
use lib \"$(LIB_DIR)\";\n\
\n\
use $(BASE_PACKAGE);\n\
\n\
# Solving the Rosenbrock test problem.\n\
$(BASE_PACKAGE)->rosenbrock();\n\
\n\
# =============================================================================\n\
# vim:set nu:et:ts=4:sw=4:\n\
# =============================================================================
endef

# Woods:
define SCRIPT2_FULL
#!/usr/bin/env perl\n\
# =============================================================================\n\
# nlp-unconstrained-core/hooke-jeeves/perl/$(BIN_DIR)/$(SCRIPT2)\n\
# =============================================================================\n\
# Nonlinear Optimization Algorithms Multilang. Version 0.1\n\
# =============================================================================\n\
\n\
use strict;\n\
use warnings;\n\
use v5.10;\n\
\n\
use lib \"$(LIB_DIR)\";\n\
\n\
use $(BASE_PACKAGE);\n\
\n\
# Solving the Woods test problem.\n\
$(BASE_PACKAGE)->woods();\n\
\n\
# =============================================================================\n\
# vim:set nu:et:ts=4:sw=4:\n\
# =============================================================================
endef

# Making the target.
$(BIN_DIR) $(LIB_DIR):
	$(CD) $(SRC_DIR); \
	if [ -n "$$($(PERL) $(PERLFLAGS) $(BASE_CLASS) |& $(GREP) 'failed')" ]; then \
		$(ECHO) "Error: Something gets wrong... Exiting..."; \
		$(EXIT) $(EXIT_FAILURE); \
	fi; \
	$(CD) -

	if [ ! -d "$(BIN_DIR)" ]; then \
		$(MKDIR) $(BIN_DIR); \
		if [ ! -d "$(LIB_DIR)" ]; then \
			$(MKDIR) $(LIB_DIR); \
		fi; \
		$(ECHO) $(ECHOFLAGS) "$(SCRIPT1_FULL)" > $(BIN_DIR)/$(SCRIPT1); \
		$(ECHO) $(ECHOFLAGS) "$(SCRIPT2_FULL)" > $(BIN_DIR)/$(SCRIPT2); \
		$(SED) $(SEDFLAGS) $(SEDREGEX) $(BIN_DIR)/*; \
		$(CHMOD) $(CHMODFLAGS) $(CHMODMODE) $(BIN_DIR)/*; \
		$(CP) $(CPFLAGS) $(CLASSES) $(LIB_DIR); \
	fi

.PHONY: all clean

all: $(BIN_DIR) $(LIB_DIR)

clean:
	$(RM) $(RMFLAGS) $(BIN_DIR) $(LIB_DIR)

# =============================================================================
# vim:set nu:et:ts=4:sw=4:
# =============================================================================

{'fraction_non_alphanumeric': 0.44607275999485796, 'fraction_numerical': 0.008998585936495693, 'mean_word_length': 4.948012232415902, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1881780', 'n_tokens_mistral': 2531, 'n_tokens_neox': 2263, 'n_words': 505}